I would like to globally hide the navigation bar, so I don't need to do .navigationBarHidden(true)
on each view's onAppear
.
Is there a global way to do that?
Thanks
You can use extension of NavigationController to handle its visibility on global level like this
extension UINavigationController{
open override func viewWillLayoutSubviews() {
setNavigationBarHidden(true, animated: false)
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.