2

i have implemented View controller-based status bar appearance to YES in my application.

I have implemeted biometric authentication in my application. but the issue is my UIViewController has .lightContent and when biometric dialog presents for authentication it has .default style so please guide me how can i change the statusBar style of biometric authentication controller.

here is the reference screens.

1. UIViewController with Light Content enter image description here

2. Biometric authentication enter image description here

please guide me how to change biometric authentication statusBar style?

Thanks

Kuldeep
  • 4,466
  • 8
  • 32
  • 59

3 Answers3

0

Override this method on the ViewController:

override var preferredStatusBarStyle: UIStatusBarStyle {
    return .lightContent
}
0

Try to add this method in ViewController and you may need to set myViewController.modalPresentationCapturesStatusBarAppearance = true on the view controller to be presented modally.

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    self.setNeedsStatusBarAppearanceUpdate()
}
override var preferredStatusBarStyle: UIStatusBarStyle {
    return .lightContent
}
Kishan Bhatiya
  • 2,175
  • 8
  • 14
0

you can manually change status bar style when biometric authentication controller open

 UIApplication.shared.statusBarStyle = .lightContent

or

  UIApplication.shared.statusBarStyle = .default
Chetan Hedamba
  • 293
  • 2
  • 9