[英]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.