hgoz
hgoz

Reputation: 641

How to add TabBarItem to default TabBarController without setting it as ViewController

I'm not using a custom TabBarContoller. Instead of this, i created a TabBarController on storyboard and add my ViewControllers from there. However i need to bind a TabBarItem with UIImagePicker just like clicking button to open UIImagePicker, so there is no need to add another empty ViewController i guess..

I'm not able to drag and drop a new TabBarItem it to TabBarController. Is there a way to do this without implementing a custom TabBarController ?

Upvotes: 0

Views: 180

Answers (1)

rdelmar
rdelmar

Reputation: 104082

No, you can't do that -- the tab bar items come from the content controllers, not directly from the tab bar controller. You'll have to add a separate controller, from which you can launch the image picker in its viewDidAppear method, so it will show up as soon as you switch to that tab.

Upvotes: 1

Related Questions