Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITabBarController storyboard launch screen - initial tab?

I'm using a storyboard as my launch screen in my app, it contains a UITabBarController with 5 UINavigationControllers. The storyboard doesn't do anything but provide launch screens.

What I want to do is change the default selected tab. I'm currently stuck with this:launch tab bar

And once the actual view controllers load I get this:

actual tab bar

As you can imagine it's a bit jarring to have the selection jump like it does. I don't know how to change the tab programmatically since I cannot attach a custom class to anything in a launch screen. Of course, I don't really care if I do it for real, if there's a way to fake it with icons of different colors, that's fine as well, but the system adds that tint to selected icon.

Is there a way to do this with a storyboard launch screen? Thanks.

like image 720
hokiewalrus Avatar asked Oct 19 '22 01:10

hokiewalrus


1 Answers

Don't use a tab bar controller in your LaunchScreen.storyboard. Instead use a normal view controller and add a tab bar, then add tab bar items as required. That seems to be the only way to make a tab bar without any index selected.

like image 90
mnl Avatar answered Nov 15 '22 20:11

mnl