【发布时间】:2015-08-13 05:08:36
【问题描述】:
我有一个自定义 UIStoryboardSegue 类,我正在尝试从导航控制器转换视图,以便我的导航栏保持不变。
目前,我正在向视图控制器展示:
self.sourceViewController.presentViewController(self.destinationViewController as! UIViewController, animated: false, completion: nil);
我想使用:
self.navigationController?.pushViewController(self.destinationViewController as! UIViewController, animated: false);
但是,我无法访问 Segue 类中的 navigationController 对象。有什么方法可以从此类中访问navigationController 变量吗?
【问题讨论】:
-
要达到segue的superview,试试self.superview,为什么不self.superview.pushViewController(...)
-
@Lamasse:当我尝试这样做时,我收到一个错误,指出该类没有名为“superview”的成员。有什么想法吗?
标签: ios swift uinavigationcontroller uistoryboardsegue