快捷标签栏视图prepareforsegue

快捷标签栏视图prepareforsegue,第1张

快捷标签栏视图prepareforsegue

您是否检查

prepareForSegue
过TabBarController中的是否曾经被调用

永远不会调用它,因为a

UITabBarController
及其子视图控制器之间的连接不是情节提要。您应该
UITabBarController
通过
viewControllers
在所需索引处访问viewController的集合来直接从viewController获得对其的引用。

var tabBarController = segue.destination as UITabBarControllervar destinationViewController = tabBarController.viewControllers[0] as YourViewController // or whatever tab index you're trying to accessdestination.property = "some value"


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5010314.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-14
下一篇 2022-11-14

发表评论

登录后才能评论

评论列表(0条)

保存