Can anyone please tell me how to set the default tab when using storyboards in iOS. I can\'t seem to figure out how to accomplish this.
Thank you
My variant is suitable when you want just change the default selected controller, no more customizing. Just add the follow category:
// UITabBarController+DefaultPage.h
#import
@interface UITabBarController(DefaultPage)
@end
// UITabBarController+DefaultPage.m
#import "UITabBarController+DefaultPage.h"
@implementation UITabBarController(DefaultPage)
- (void)viewDidLoad {
[super viewDidLoad];
self.selectedIndex = 1;
}
@end
p.s: I prefer @joshua-finch answer