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

Banner shows under status bar #56

Closed
anthonyvallone opened this issue Sep 25, 2017 · 3 comments
Closed

Banner shows under status bar #56

anthonyvallone opened this issue Sep 25, 2017 · 3 comments

Comments

@anthonyvallone
Copy link

Both NotificationBanner & StatusBarNotificationBanner show underneath status bar.

@anthonyvallone
Copy link
Author

anthonyvallone commented Sep 25, 2017

in BaseNotificationBanner.swift

if let parentViewController = parentViewController {
                parentViewController.view.addSubview(self)
                if statusBarShouldBeShown() {
                    appWindow.windowLevel = UIWindowLevelStatusBar + 1
                }
            } else {
                appWindow.addSubview(self)
                if statusBarShouldBeShown() && !(parentViewController == nil && bannerPosition == .top) {
                    appWindow.windowLevel = UIWindowLevelStatusBar + 1
                } else {
                    appWindow.windowLevel = UIWindowLevelStatusBar + 1
                }
            }

I changed the above to

if let parentViewController = parentViewController {
                parentViewController.view.addSubview(self)
                if statusBarShouldBeShown() {
                    appWindow.windowLevel = UIWindowLevelNormal
                }
            } else {
                appWindow.addSubview(self)
                if statusBarShouldBeShown() && !(parentViewController == nil && bannerPosition == .top) {
                    appWindow.windowLevel = UIWindowLevelNormal
                } else {
                    appWindow.windowLevel = UIWindowLevelStatusBar + 1
                }
            }

and now its on top, but I'm not sure if thats correct.

@Daltron
Copy link
Owner

Daltron commented Sep 25, 2017

Hi @trianglepixel! 😄 There is no need to change the code for what you are wanting to do. As the README states:

By default, each banner will be displayed on the main application window. If you are wanting to show a banner below a navigation bar, simply show on the view controller that is within the navigation system:

banner.show(on: viewController)

So what you need to do is forgo the on parameter and your banner will show above the navigation bar 👍

@Daltron Daltron closed this as completed Sep 25, 2017
@anthonyvallone
Copy link
Author

@Daltron Yes I see the issue now. Thanks.

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

No branches or pull requests

2 participants