Upon login, I would like to program so that it shows the first tab. It does that when I first run the app but when I logout and log in again, it shows the second tab which is where the logout option is.
Is there a line of code where I could put which ensures the first tabbar item to be loaded everytime the user logs in?
Thanks in advance.
When the user logs out, or when the application closes, you should call this code:
This will enable you to force the
UITabBarControllerto selected the first tab.Update
You can get the
UITabBarControllerinstance from the UI application delegate. Eg. using the standard tab bar sample application:where
MyAppDelegateis the name of yourid<UIApplicationDelegate>class.