[英]Method of UINavigationController to add a view controller to navigation stack?
UINavigationController的哪种方法用于将视图控制器快速添加到导航堆栈?
Normally, the following method is used to push UIViewController
to UINavigationController
's navigation stack 通常,以下方法用于将
UIViewController
推送到UINavigationController
的导航堆栈
pushViewController(_ viewController: UIViewController, animated: Bool)
This is implemented inside your CustomViewController
class in the following way: 这是通过以下方法在
CustomViewController
类中实现的:
let someVC: CustomViewController = CustomViewController() // this is one way of initializing it
self.navigationController?.pushViewController(someVC, animated: true)
The following is another method which can be used to add a UIViewController
to UINavigationController
stack 以下是可用于将
UIViewController
添加到UINavigationController
堆栈的另一种方法
setViewControllers(_ viewControllers: [UIViewController], animated: Bool)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.