Programmatically change tabBar item?

You need to replace second tab associated viewcontroller by a new viewcontroller. here is sample code, which may help you:

NSMutableArray *viewControllers = [[NSMutableArray alloc] initWithArray:self.tabBarController.viewControllers];
UIViewController *newVC = [UIViewController new];
UINavigationController *newNav = [[UINavigationController alloc] initWithRootViewController:newVC];
[viewControllers replaceObjectAtIndex:1 withObject:newNav];
self.tabBarController.viewControllers = viewControllers 

Check if user is logged in and then change view controllers of UITabBarController:

tabbarController.viewControllers?.replaceRange()

Also this may help Set view controllers of UITabBarController in Swift