Hide status bar at event iOS > 9
class ViewController: UIViewController {
var isHidden:Bool = false
@IBAction func clicked(sender: AnyObject) {
isHidden = !isHidden
UIView.animateWithDuration(0.5) { () -> Void in
self.setNeedsStatusBarAppearanceUpdate()
}
}
override func preferredStatusBarUpdateAnimation() -> UIStatusBarAnimation {
return UIStatusBarAnimation.Slide
}
override func prefersStatusBarHidden() -> Bool {
return isHidden
}
}