I have an iOS app with multiple views.
A login UIView
that the user first sees, and upon entering the right credentials, he will then be taken to the main TabBarViewController
, that 'manages' the rest of the views.
The login UIView
is connected to the TabBarViewController
with a modal Segue. I also use this Segue to pass data from the Login view to the TabBarViewController
, by using properties. All is fine until now.
As mentioned, there are other views, connected to this TabBarViewController
, and this tab bar only displays them.
The question is, how can I access the property of TabViewController
(which the loginView sets with a certain value), in other Views ?
I want to be able to access this property from multiple other views.
Thanks.
Something you haven't made clear here. I'm assuming that you have subclassed
UITabBarController
.If all the view controllers are children of the tab bar controller, then
self.tabBarController
will give you access to the tab bar.It may end up looking something like this: