[英]Access UITabBarController to assign action via Storyboards
沒有情節提要,我可以簡單地分配UITabBarController.delegate = self
(例如,在AppDelegate
)。 這使我能夠處理在按下UITabBarButton
上的UITabBar
時發生的情況。
但是,我現在使用情節提要,其中UIViewController
包含在UINavigationController
, UINavigationController
包含在UITabBarController
。
用代碼訪問此父UITabBarController
的最佳方法是什么? 我想這樣做,所以我可以為其指派一個代表。 當用戶按下UITabBar
的按鈕時,我想在我包含的UIViewController
一個操作。
self.navigationController?.tabBarController
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.