2

I am trying to make one of my tabs to be the first screen to show on the start of the app I have 5 view controllers embeded with navigation controllers

how can I choose any of the tabs to start on the view did load ?

user2989513
  • 81
  • 2
  • 9

1 Answers1

0
override func viewDidAppear(_ animated: Bool) {
    self.tabBarController?.selectedIndex = 2
}

A selected index of 2 will select your third tab.

It's to put in the viewDidAppear if you first ViewController.

Maxime
  • 838
  • 6
  • 18