Reputation: 73
I am using Xcode 11.3.1, Swift 5. I made tabBarController with MainStoryBoard. Now I want to move on third item(another view controller) from first item(shown view controller), on click on button as shown in figure.
How to do I that?? Thanks in advance.
Upvotes: 0
Views: 63
Reputation: 14397
Here is how you can do that
//MARK:- if you are in UITabBarController
self.selectedIndex = 2
or
tabBarController?.selectedIndex = 2
Upvotes: 1