nytimes / NYTPhotoViewer

A modern photo viewing experience for iOS.
http://open.blogs.nytimes.com/2015/03/27/a-new-view-for-nytimes-photos/
Other
2.86k stars 378 forks source link

add 'statusBarMode' to drive whether the status bar is hidden or not. #336

Open mr-fixit opened 3 years ago

mr-fixit commented 3 years ago

contents of #221, plus a couple tweaks.

cc @sergiog90

Original PR contents:

Allow developers to show the status bar with navigation bar buttons without overlaps.

If gallery is showed with visible status bar the navigation buttons overlaps it, with this small change you can set to move content origin under status bar to prevent it.

Before: captura de pantalla 2016-11-24 a las 15 50 47

After: captura de pantalla 2016-11-24 a las 15 49 44

Code:

private class PhotosViewController: NYTPhotosViewController {
    override var prefersStatusBarHidden: Bool {
        return false
    }

    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .lightContent
    }
}

let viewer = PhotosViewController(photos: [photo], initialPhoto: photo, delegate: nil)
viewer.underStatusBar = true
self.present(viewer, animated: true, completion: nil)
mr-fixit commented 3 years ago

@ZevEisenberg, if you like my notch code, this is ready to merge.