美文网首页
swift navigationController 返回 指定

swift navigationController 返回 指定

作者: 蜗牛锅 | 来源:发表于2017-09-02 11:17 被阅读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)
                        }
                    }               
    

    相关文章

      网友评论

          本文标题:swift navigationController 返回 指定

          本文链接:https://www.haomeiwen.com/subject/yqnljxtx.html