Although some implementations are cleaner, such as:
UIApplication.shared.isStatusBarHidden = true
There are some weird clipping animations during transitions. Although more verbose, I prefer the @MachTurtle solution:
override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(true) if let statusBar: UIView = UIApplication.shared.value(forKey: "statusBar") as? UIView{ statusBar.isHidden = true } } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(true) let statusBar: UIView = UIApplication.shared.value(forKey: "statusBar") as! UIView statusBar.isHidden = false }
Try it, works great for me.
Creeptosis
source share