Skip to content

Commit

Permalink
update for swift 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-0000 committed Sep 14, 2018
1 parent 65ab36a commit 547aad8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SKPhotoBrowser/SKActionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ extension SKActionView {
}

if let image = image {
closeButton.setImage(image, for: for: .normal)
closeButton.setImage(image, for: .normal)
}
}

Expand Down
1 change: 0 additions & 1 deletion SKPhotoBrowser/SKPagingScrollView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion SKPhotoBrowser/SKPhotoBrowser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
10 changes: 9 additions & 1 deletion SKPhotoBrowser/SKToolbar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down

0 comments on commit 547aad8

Please sign in to comment.