Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

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 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
@@ -11,6 +11,8 @@ fi

cd "$(dirname "$0")/../Examples"

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.

@@ -41,6 +41,12 @@ extern NSString * const NYTPhotosViewControllerDidDismissNotification;

@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