From 53f171a400875514b0f889a5e5f60ae76d8ff897 Mon Sep 17 00:00:00 2001 From: tilltue Date: Tue, 17 Oct 2017 16:56:43 +0900 Subject: [PATCH] bug fix. iPhone x, iOS 11 safe area closed #30 --- .../TLPhotosPickerViewController.swift | 7 +++++- .../Classes/TLPhotosPickerViewController.xib | 23 +++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift b/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift index 31702c10..466c4061 100644 --- a/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift +++ b/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift @@ -71,7 +71,8 @@ open class TLPhotosPickerViewController: UIViewController { @IBOutlet open var customNavItem: UINavigationItem! @IBOutlet open var doneButton: UIBarButtonItem! @IBOutlet open var cancelButton: UIBarButtonItem! - + @IBOutlet open var navigationBarTopConstraint: NSLayoutConstraint! + public weak var delegate: TLPhotosPickerViewControllerDelegate? = nil public var selectedAssets = [TLPHAsset]() public var configure = TLPhotosPickerConfigure() @@ -168,6 +169,10 @@ open class TLPhotosPickerViewController: UIViewController { if self.thumbnailSize == CGSize.zero { initItemSize() } + if #available(iOS 11.0, *) { + } else if self.navigationBarTopConstraint.constant == 0 { + self.navigationBarTopConstraint.constant = 20 + } } override open func viewWillAppear(_ animated: Bool) { diff --git a/TLPhotoPicker/Classes/TLPhotosPickerViewController.xib b/TLPhotoPicker/Classes/TLPhotosPickerViewController.xib index 8064dbe3..bdc9275c 100644 --- a/TLPhotoPicker/Classes/TLPhotosPickerViewController.xib +++ b/TLPhotoPicker/Classes/TLPhotosPickerViewController.xib @@ -1,11 +1,12 @@ - + - + + @@ -17,6 +18,7 @@ + @@ -42,29 +44,29 @@ - + - + - + - + @@ -165,17 +167,18 @@ - + - + +