class ALNavigationController: UINavigationController {
override func viewDidLoad() {
super.viewDidLoad()
setNavBar()
interactivePopGestureRecognizer?.delegate = nil
navigationBar.isTranslucent = false
}
override func pushViewController(_ viewController: UIViewController, animated: Bool) {
if viewControllers.count >= 1 {
viewController.hidesBottomBarWhenPushed = true
}
super.pushViewController(viewController, animated: animated)
}
func setNavBar() {
let appearance = UINavigationBar.appearance()
appearance.shadowImage = UIImage()
appearance.isTranslucent = false
appearance.theme_barTintColor = AutoColor.bg1
appearance.titleTextAttributes = [.foregroundColor: Color.head, .font: autoBoldFont(font: 18)]
if #available(iOS 15.0, *) {
let newAppearance = UINavigationBarAppearance()
newAppearance.configureWithOpaqueBackground()
newAppearance.theme_backgroundColor = AutoColor.bg1
newAppearance.shadowImage = UIImage()
newAppearance.shadowColor = nil
newAppearance.titleTextAttributes = [.foregroundColor: Color.head, .font: autoBoldFont(font: 18)]
appearance.standardAppearance = newAppearance
appearance.scrollEdgeAppearance = appearance.standardAppearance
}
}
}