简体   繁体   中英

iOS tab bar item with no controller associated

I have my own subclass of UITabBarController. I am trying now to add a simple button (UITabBarItem) in the storyboard. The thing is that I don't want to associate a controller with it. An action on that item will simply fire a prompting alert to confirm switching between two modes.

So, what is the clean way to add an element in tab bar from StoryBoard without linking to anything (and doing stuff programatically) ?

is this what you're looking for? Via delegation you can define the items' behaviour set up an action with a tab bar item - iphone

edit: i don't know about storyboard only. but doing it that way wouldn't really be hard. Define your custom TabBarController, use the delegate method and implement your logic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM