diff --git a/SKPhotoBrowser/SKActionView.swift b/SKPhotoBrowser/SKActionView.swift index e9fa9134..51fdd192 100644 --- a/SKPhotoBrowser/SKActionView.swift +++ b/SKPhotoBrowser/SKActionView.swift @@ -100,7 +100,7 @@ extension SKActionView { } if let image = image { - closeButton.setImage(image, for: for: .normal) + closeButton.setImage(image, for: .normal) } } diff --git a/SKPhotoBrowser/SKPagingScrollView.swift b/SKPhotoBrowser/SKPagingScrollView.swift index 9e17d1e6..fff43e0b 100644 --- a/SKPhotoBrowser/SKPagingScrollView.swift +++ b/SKPhotoBrowser/SKPagingScrollView.swift @@ -43,7 +43,6 @@ class SKPagingScrollView: UIScrollView { visiblePages.removeAll() recycledPages.removeAll() } - func loadAdjacentPhotosIfNecessary(_ photo: SKPhotoProtocol, currentPageIndex: Int) { guard let browser = browser, let page = pageDisplayingAtPhoto(photo) else { diff --git a/SKPhotoBrowser/SKPhotoBrowser.swift b/SKPhotoBrowser/SKPhotoBrowser.swift index 01bf6042..c606ba42 100644 --- a/SKPhotoBrowser/SKPhotoBrowser.swift +++ b/SKPhotoBrowser/SKPhotoBrowser.swift @@ -400,7 +400,7 @@ internal extension SKPhotoBrowser { } func frameForPaginationAtOrientation() -> CGRect { - let offset = UIInterfaceOrientationIsLandscape(UIApplication.shared.statusBarOrientation) ? 35 : 44 + let offset = UIDevice.current.orientation.isLandscape ? 35 : 44 return CGRect(x: 0, y: self.view.bounds.size.height - CGFloat(offset), width: self.view.bounds.size.width, height: CGFloat(offset)) } diff --git a/SKPhotoBrowser/SKToolbar.swift b/SKPhotoBrowser/SKToolbar.swift index 6b474636..5a726c1e 100644 --- a/SKPhotoBrowser/SKToolbar.swift +++ b/SKPhotoBrowser/SKToolbar.swift @@ -13,7 +13,6 @@ private let bundle = Bundle(for: SKPhotoBrowser.self) class SKToolbar: UIToolbar { var toolActionButton: UIBarButtonItem! - fileprivate weak var browser: SKPhotoBrowser? required init?(coder aDecoder: NSCoder) { @@ -31,6 +30,15 @@ class SKToolbar: UIToolbar { setupApperance() setupToolbar() } + + override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { + if let view = super.hitTest(point, with: event) { + if SKMesurement.screenWidth - point.x < 50 { // FIXME: not good idea + return view + } + } + return nil + } } private extension SKToolbar {