123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // ADHBaseNavigationController.swift
- // ADHTuanCan
- //
- // Created by 敖德亨 on 2023/11/1.
- //
- import UIKit
- class ADHBaseNavigationController: UINavigationController {
- override func viewDidLoad() {
- super.viewDidLoad()
- navigationBar.isHidden = true
- }
-
- /// 重写Push方法
- /// 所有的push动作都会调用此方法
- /// - Parameters:
- /// - viewController: 需要push的VC
- /// - animated: 是否动画
- override func pushViewController(_ viewController: UIViewController, animated: Bool) {
-
- //如果不是栈底的控制器才需要隐藏,跟控制器不需要处理
- if viewControllers.count > 0{
- //隐藏tabBar
- viewController.hidesBottomBarWhenPushed = true
- }
- super.pushViewController(viewController, animated: true)
- }
- /*
- // MARK: - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
- // Get the new view controller using segue.destination.
- // Pass the selected object to the new view controller.
- }
- */
- }
|