I've seen an app wherein they can dynamically adjust their status bar height/y-position based on scroll-position.
Here is a sample gif: https://gyazo.com/ec8e3fa336098305e6a5aedc68118789
Here is what I got
override var prefersStatusBarHidden: Bool {
return isStatusBarHidden
}
override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
if !isStatusBarHidden {
return UIStatusBarAnimation.fade
} else {
return UIStatusBarAnimation.slide
}
}
func changeStatusBarStatus(status: Bool) {
isStatusBarHidden = status
UIView.animate(withDuration: 0.3, delay: 0, options: [.allowUserInteraction], animations: {
self.setNeedsStatusBarAppearanceUpdate()
})
}