Skip to content

Conversation

@mr-fixit
Copy link
Contributor

@mr-fixit mr-fixit commented Dec 9, 2020

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
Copy link
Contributor Author

mr-fixit commented Jan 6, 2021

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

@mr-fixit mr-fixit requested a review from ZevEisenberg January 15, 2021 11:03
@mr-fixit mr-fixit changed the title Move content under statusBar if prefersStatusBarHidden is false add 'statusBarMode' to drive whether the status bar is hidden or not. Jan 20, 2021

bundle config set path 'vendor/bundle'
# uncomment the following if you get errors about not having access to the system's install
# bundle config --local path 'vendor/bundle'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually pretty rare to mention this stuff in a script like this. If we want to guide people on their ruby setup, maybe we should do it in the readme instead, under a "Contributing" section?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm happy to delete it. it's probably wrong-advice anyway.

@interface NYTPhotosViewController : UIViewController

typedef NS_ENUM(NSUInteger, NYTPhotoViewerStatusBarMode) {
NYTPhotoViewerStatusBarModeDynamic, /* hide statusbar when view.safeArea.top == 0 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A doc comment instead of a regular comment would make this show up in the inline doc viewer. Probably best to add comments for all the cases.

@noremac noremac removed their request for review March 9, 2021 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants