Created
June 2, 2021 18:39
-
-
Save yccheok/b32fd2d321c18818037a62e06b1bbab9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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