ADHBaseNavigationController.swift 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // ADHBaseNavigationController.swift
  3. // ADHTuanCan
  4. //
  5. // Created by 敖德亨 on 2023/11/1.
  6. //
  7. import UIKit
  8. class ADHBaseNavigationController: UINavigationController {
  9. override func viewDidLoad() {
  10. super.viewDidLoad()
  11. navigationBar.isHidden = true
  12. }
  13. /// 重写Push方法
  14. /// 所有的push动作都会调用此方法
  15. /// - Parameters:
  16. /// - viewController: 需要push的VC
  17. /// - animated: 是否动画
  18. override func pushViewController(_ viewController: UIViewController, animated: Bool) {
  19. //如果不是栈底的控制器才需要隐藏,跟控制器不需要处理
  20. if viewControllers.count > 0{
  21. //隐藏tabBar
  22. viewController.hidesBottomBarWhenPushed = true
  23. }
  24. super.pushViewController(viewController, animated: true)
  25. }
  26. /*
  27. // MARK: - Navigation
  28. // In a storyboard-based application, you will often want to do a little preparation before navigation
  29. override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
  30. // Get the new view controller using segue.destination.
  31. // Pass the selected object to the new view controller.
  32. }
  33. */
  34. }