繁体   English   中英

UINavigationController的方法将视图控制器添加到导航堆栈?

[英]Method of UINavigationController to add a view controller to navigation stack?

UINavigationController的哪种方法用于将视图控制器快速添加到导航堆栈?

通常,以下方法用于将UIViewController推送到UINavigationController的导航堆栈

pushViewController(_ viewController: UIViewController, animated: Bool)

这是通过以下方法在CustomViewController类中实现的:

let someVC: CustomViewController = CustomViewController() // this is one way of initializing it
self.navigationController?.pushViewController(someVC, animated: true)

以下是可用于将UIViewController添加到UINavigationController堆栈的另一种方法

setViewControllers(_ viewControllers: [UIViewController], animated: Bool)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM