Closed Gouthamansriniv closed 6 years ago
You have to provide 1 view controller for each position. For eg For position 0 = FirstViewController For position 1 = SecondViewController `
if position == 0 {
let vc1 = self.storyboard?.instantiateViewController(withIdentifier: "ItemViewController") as! ItemViewController
return vc1
} else if position == 1 {
let vc2 = self.storyboard?.instantiateViewController(withIdentifier: "second") as! SecondViewController
return vc2
} else {
let vc3 = ....
return vc3
} `
Thanks for your support nrlnishan.
Hello can you please help to switch between three different view controllers
func viewControllerAtPosition(position:Int) -> UIViewController { let vc = self.storyboard?.instantiateViewController(withIdentifier: "ItemViewController") as! ItemViewController