Created
December 4, 2018 19:42
-
-
Save longvudai/68617e77c2d0f0427b2aa238f2880a20 to your computer and use it in GitHub Desktop.
set preferredStatusBarStyle when view controller is presented
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in myViewController | |
class MyViewController: UIViewController { | |
override var preferredStatusBarStyle: UIStatusBarStyle { | |
return .lightContent | |
} | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
modalPresentationCapturesStatusBarAppearance = true //allow this VC to control the status bar appearance | |
modalPresentationStyle = .overFullScreen //dont dismiss the presenting view controller when presented | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment