0
votes

A little background that I think will help in this question: I am working on an iOS7 app which basically presents various quotes and allows the user to share these quotes through facebook or twitter. I am implementing this through a tab bar (not a tab bar controller) that I placed at the bottom of the first view controller in the screenshot.

The tab bar's delegate (file owner) is set to be the view controller that it's in. In there I edited the tabbar: didSelectItem: method to handle every button press accordingly. (The first two button presses are just modal segues to twitter and facebook tools.)

Now my question: Now I am trying to get the third item in the tab bar to cause a segue to the third view controller (upper right). Can I make a tab bar item perform a push segue? How would I go about doing that?

I have been trying to look for a way to do this but seemed to be stumped. I was thinking that maybe this can be done with a tab bar view controller but then I wasn't sure how I could have my original first two tab bar items perform modal segues

Any help would be appreciated

UPDATE: The two view controllers at the bottom are segued into when the user touches either of the two views in the first view controller (can be ignored for this queston). The third VC (in the top right) I want to be pushed when the user touches the third tab bar item. The bottom two views just display info about quote presented... the top right vc allows the user to enter a new quote and save it.

enter image description here

1
How is what you're trying to do with the third view controller different from what you did with the first two? They're all segues right?rdelmar
The two view controllers at the bottom are segued into when the user touches either of the two views in the first view controller. The third VC (in the top right) I want to be pushed when the user touches the third tab bar item. The bottom two views just display info about quote presented... the top right vc allows the user to enter a new quote and save itcrazyCoder

1 Answers

2
votes

You only need to connect a segue from the controller with the tab bar to the third controller, and call it manually in the didSelectItem method,

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item {
    if ([item.title isEqualToString:@"Third"]) { // or whatever your title is
        [self performSegueWithIdentifier:@"GoToThird" sender:self];
}