简体   繁体   English

其他ViewController中的选项卡栏控制器方法和属性

[英]Tab Bar Controller Methods and Properties in other ViewControllers

I have been looking around and I can't find any clear answers. 我一直在环顾四周,找不到清晰的答案。 How can I access methods and properties written in the TabBarController from a ViewController attached to it? 如何从与其连接的ViewController访问TabBarController中编写的方法和属性?

The TabBarController has ViewControllers A and B attached to it. TabBarController附加了ViewController A和B。 VCA has VA1, and VCB has VC2 each connected by a segue. VCA具有VA1,VCB具有VC2,每一个都通过segue连接。 How can I allow VC1 to use methods and properties found on TabBarController. 如何允许VC1使用TabBarController上的方法和属性。

在这种情况下,可以通过子VC的parentViewController来访问选项卡栏控制器,除非它们位于其自身的容器中,例如导航VC,那么您将需要上一层。

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

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