p.yarandi p.yarandi - 5 months ago 15
Swift Question

Using data in another tab of UITabBarController

I'm working on an app have three tabs

UITabBarController
. In the second tab's
UIViewController
I have some variables I want to use them with their values in first tab. What should I do?

Answer

Each tab and its controller stack in a UITabBarControllershould be independent.

If you are passing some settings value I would recommend you to use a NSUSerDefault to store and retrieve the user settings.

The others way is either set up a protocol or use a Observer.

Comments