Reputation: 4552
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
please guide me how to change biometric authentication statusBar
style?
Thanks
Upvotes: 2
Views: 362
Reputation: 2368
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
}
Upvotes: 0
Reputation: 291
you can manually change status bar style when biometric authentication controller open
UIApplication.shared.statusBarStyle = .lightContent
or
UIApplication.shared.statusBarStyle = .default
Upvotes: 0
Reputation:
Override this method on the ViewController
:
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
Upvotes: 0