Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Good
@IBAction func sideMenuClicked(_ sender: UIBarButtonItem) {
statusBarHidden = true
self.navigationController?.additionalSafeAreaInsets.top = 20
UIView.animate(withDuration: Constants.config_shortAnimTime) { () -> Void in
self.setNeedsStatusBarAppearanceUpdate()
}
}
// Bad
@IBAction func sideMenuClicked(_ sender: UIBarButtonItem) {
self.navigationController?.additionalSafeAreaInsets.top = 20
statusBarHidden = true
UIView.animate(withDuration: Constants.config_shortAnimTime) { () -> Void in
self.setNeedsStatusBarAppearanceUpdate()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment