I am using a tab bar which has 4 tabs and I want to set the second tab as default. I wrote the following code:
self.tabBarController!.selectedIndex = 2
But I got the following error:
fatal error: unexpectedly found nil while unwrapping an Optional value
And one more thing can I hide a UIViewController or UITabBarController if yes then how?
you should do it in
AppDelegate
class ondidFinishLaunchingWithOptions
method like that