Skip to content

Instantly share code, notes, and snippets.

@yccheok
Created June 2, 2021 18:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yccheok/b32fd2d321c18818037a62e06b1bbab9 to your computer and use it in GitHub Desktop.
Save yccheok/b32fd2d321c18818037a62e06b1bbab9 to your computer and use it in GitHub Desktop.
// 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