I have a set of detail views that are intended to be accessible via multiple Tab Bar controllers. The main goal here is to make a particular set of tabBar items available based on some conditions of a particular item in the table.
My current approach to this is two tabBar controllers connected to the set of detail views. Tapping a cell triggers a performSegueWithIdentifier
to bring the user to the proper tabBarController and thus, allows access to the correct set of viewControllers.
Unfortunately, this produces unusual results. Depending on the specific views in each tabBar and whether or not the view is present in one or both tabBars, the view could either a) load properly with all intended views functioning as expected. b) not load all the intended views (usually only one of them) or c) load the expected navigation controller (which this is all nested in) but with a black screen and no tabBar controller. This behavior differs independently on each of the two tabBars.
How can the desired end-result be accomplished without these errors? (please provide answers in Swift) Ideally, I would like to use a single tabBar controller and conditionally show a given set of views accessible by the tabBar.