Skip to content

Instantly share code, notes, and snippets.

@gabrieltheodoropoulos
Last active October 11, 2020 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrieltheodoropoulos/2d1f7c64fde0f719695813a336500485 to your computer and use it in GitHub Desktop.
Save gabrieltheodoropoulos/2d1f7c64fde0f719695813a336500485 to your computer and use it in GitHub Desktop.
Subclass UINavigationController to override status bar style according to top view controller's preferred style
import UIKit
class CustomNavigationController: UINavigationController {
override var preferredStatusBarStyle: UIStatusBarStyle {
return topViewController?.preferredStatusBarStyle ?? .default
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment