Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modal flip in tab bar tab, only the view, storyboarding

I have a tab bar with five tabs.

In one tab I have a mapview. I have an info button in the bottom right hand corner of the map. When a user clicks the info button, I want the mapview to flip to a view that has information about the mapview. I'd like a back button in the nav bar to flip back.

How can I do that?

I've managed to create a view controller and make a modal segue, but it doesn't keep the tab bar with it. Worse still, I created a back button on the flipside-viewcontroller with a modal segue back to the mapviewcontroller, and when you go back, the tabbar is gone!

I'm using a storyboard, and most tutorials I find use nibs and xibs. The more control-clicking I can do through the storyboard-IB and the less code the better. Any help is appreciated!

like image 829
user1080937 Avatar asked Nov 27 '25 15:11

user1080937


1 Answers

Once you have created in the backButton in the MapInformation view in storyboard, you can add the following to your MapInformation.h/m:

MapInformation.h:

-(IBAction)backButton:(id)sender;

MapInformation.m:

-(IBAction)backButton:(id)sender
{
    [self.presentingViewController dismissModalViewControllerAnimated:YES];
}

After that, make sure to connect your IBAction in your storyboard(control-clicking).

like image 177
tarheel Avatar answered Nov 29 '25 07:11

tarheel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!