簡體   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