From ded0926eb9fddf0bc03fa79d552b1cbd3537ce97 Mon Sep 17 00:00:00 2001 From: Miguel Ruivo Date: Fri, 18 Mar 2022 11:55:50 +0000 Subject: [PATCH] Replaces UI_USER_INTERFACE_IDIOM() with UIDevice.current.userInterfaceIdiom --- Sources/DKImagePickerController/DKPopoverViewController.swift | 2 +- .../DKImagePickerController/View/DKAssetGroupGridLayout.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/DKImagePickerController/DKPopoverViewController.swift b/Sources/DKImagePickerController/DKPopoverViewController.swift index 3991baa6..35875311 100644 --- a/Sources/DKImagePickerController/DKPopoverViewController.swift +++ b/Sources/DKImagePickerController/DKPopoverViewController.swift @@ -199,7 +199,7 @@ open class DKPopoverViewController: UIViewController { let preferredContentSize = self.contentViewController.preferredContentSize var popoverWidth = preferredContentSize.width if popoverWidth == UIView.noIntrinsicMetric { - if UI_USER_INTERFACE_IDIOM() == .pad { + if UIDevice.current.userInterfaceIdiom == .pad { popoverWidth = self.view.bounds.width * 0.6 } else { popoverWidth = self.view.bounds.width diff --git a/Sources/DKImagePickerController/View/DKAssetGroupGridLayout.swift b/Sources/DKImagePickerController/View/DKAssetGroupGridLayout.swift index 681c7418..52f68538 100644 --- a/Sources/DKImagePickerController/View/DKAssetGroupGridLayout.swift +++ b/Sources/DKImagePickerController/View/DKAssetGroupGridLayout.swift @@ -14,7 +14,7 @@ open class DKAssetGroupGridLayout: UICollectionViewFlowLayout { super.prepare() var minItemWidth: CGFloat = 100 - if UI_USER_INTERFACE_IDIOM() == .pad { + if UIDevice.current.userInterfaceIdiom == .pad { minItemWidth = 120 }