swift navigationController 返回 指定

2017-09-02  本文已影响111人  蜗牛锅
第一种 你确定 返回的 页面在哪里
                let viewCtl = self.navigationController?.viewControllers[2];
                
                self.navigationController?.popToViewController(viewCtl!, animated: true);
        第二种 遍历 navigationController 栈  里      viewControllers 
                for VC in (self.navigationController?.viewControllers)! {
                
                    if VC.isEqual(AccountSafetyCtl.self) { // AccountSafetyCtl  是你要返回的控制器(页面)
                    
                        self.navigationController?.popToViewController(VC, animated: true)
                    }
                }               
上一篇下一篇

猜你喜欢

热点阅读