0

Is it possible to added same FirstViewController class to UITabBarController -> tabBar -> 4 items added.

ZeroTabBarController -> FirstViewController -> FirstViewController -> ThirdTabBarController.

kiran
  • 4,285
  • 7
  • 53
  • 98

1 Answers1

0

Yes, you can do what you are trying to do.

To achieve this, you have to trick it little bit.

Below is what you will structure

Tabbar
  - DummyOneVC - FirstVC
  - SecondVC
  - DummyThreeVC - FirstVC
  - FourthVC

Now in DummyOneVC, in viewWillAppear you will transition to FirstVC but without animation so that user will not know what you are doing behind.

DummyOneVC

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)

    let destVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "FirstVC") as! FirstVC
    self.navigationController?.pushViewController(destVC, animated: false)    
}
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276