Search code examples
iosswiftuiviewuinavigationbarnotificationcenter

Opening NotificationCenter creates visual bugs on NavigationBar


When Notification Center from the top get pulled, it creates a weird visual bug like navBar getting highlighted/selected. The bug occurs on only one page (of TabViewController) and happens when top notification center gets pulled and released (or closed/swiped up after opening).

I tried to screenshot it on iPhone, but it doesn't capture the bug on screenshot; whereas screenshot from Simulator shows the problem.

This is normal:

enter image description here - enter image description here

This is the bug (occurs when top action sheet gets pulled):

enter image description here enter image description here

I thought status bar's tweak might cause a problem.. When I comment these lines, the problem doesn't occurs. In AppDelegate, this is the code I use to edit StatusBar's color in didFinishLaunchingWithOptions:

 let view: UIView = UIView.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.size.width, 20))
 view.backgroundColor = UIColor.whiteColor()
 view.alpha = 1
 self.window!.rootViewController!.view.addSubview(view)

Solution

  • The problem occured because Translucent was ticked. I unticked and it's working fine now.