ios swift 判断uiviewcontroller时push present 进来的 还是pop进来的

override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        //显示navbar
        self.navigationController?.setNavigationBarHidden(false, animated: true)
        
        if(isBeingPresented || isMovingToParent){
            print("======push")
        }else{
            print("======pop")
        }
    }

  

posted @ 2019-12-24 17:48  荣超  阅读(1518)  评论(0编辑  收藏  举报