SpokaneDude
SpokaneDude

Reputation: 4984

How to use UIButton to transfer to another Storyboard scene

I have an iPad app, using XCode 4.5, Storyboards, UITabBarController and iOS 6. I want to have the user tap a button ("New") that will transfer to a scene where a new Client Info can be entered. Yes, he/she could tap the UITabBar and do the same thing, but I need to make this very,very user friendly.

I have been looking at SO for "push" segues, but not sure it would do the job. Can someone please point me in the right direction? (a URL to a doc would be appreciated).

Upvotes: 0

Views: 144

Answers (1)

Gabriele Petronella
Gabriele Petronella

Reputation: 108151

Push segues make sense only in the context of a UINavigationController.

What you need to do is just to associate your button to an IBAction that will change the tab programmatically, something like

- (IBAction)switchToClientInfoTab {
    [self.tabBarController setSelectedIndex:1]; // change 1 to the actual index of your tab
}

Segues are now the way of proceeding here.

Upvotes: 1

Related Questions