Take the 2-minute tour ×

I've built out the raised-center UITabBar from this GitHub location.

My challenge now is that I can't figure out how to create a modal view that will appear when the button is pressed.

Has anyone used the idev-recipes RaisedCenterTabBar with luck? How did you implement the modal sheet that appears there?

Alternatively, is there a different gitHub project that has a working custom tab bar with a modal sheet?

Thank you!

share|improve this question
Why not just use a normal presentModalViewController call? Do you want the TabBar to appear on top of the Modal Sheet? –  ThePaddedCell Aug 30 '11 at 9:31
No, I don't need the tab bar to appear on the modal view. My issue is figuring out how to handle the delegate for the modalviewcontroller. What object do I assign as delegate? The AppDelegate? The tabBarController? –  bryanjclark Aug 30 '11 at 16:30

2 Answers 2

up vote 2 down vote accepted

I have something similar in a program of mine that I'm working on and would be glad to show you how I do it. I have a couple of viewControllers in a TabBar. I create my Plus button in whichever VC I decide will appear first on the screen in ViewDidLoad.

    // Create a plus button that appears on the tabBar
UIImage *plusButton = [UIImage imageNamed:@"plusbutton.png"];
UIView *tabBarView = [[self tabBarController] view];
addButton = [UIButton buttonWithType:UIButtonTypeCustom];
[addButton setFrame:CGRectMake(127.0, 432.0, [plusButton size].width, [plusButton size].height)];
[addButton setBackgroundImage:plusButton forState:UIControlStateNormal];
[tabBarView addSubview:addButton];
[addButton addTarget:self action:@selector(scalePicker:) forControlEvents:UIControlEventTouchUpInside];    

I make the button a subView of the tabBarController's view. Later on in the implementation of this VC I have a method called scalePicker: which creates and instance of one of my other VC's and presents it modally. Here is the code for that: (note: this is the method that I set as a target for the plus button in the code above)

    -(void) scalePicker:(id)sender
    // create the view scalePicker, set it's title and place it on the top of the view hierarchy
sp = [[ScalePickerVC alloc] init];
[self presentModalViewController:pickerNavController animated:YES];

I hope this helps you, Good Luck!

share|improve this answer
That did the trick! Thank you SO much. –  bryanjclark Sep 5 '11 at 5:00

Here was my solution, it was BY FAR the cleanest way I found to do this... I really hope it helps, I spent hours researching the best ways.

I setup a "UITabBarController" delegate that connects directly to my tab interface built out on my storyboard.

** Don't forget to include the "tabBarController" delegate in your header file

** Notice this callback method is NOT the "didSelectViewController" but rather the "shouldSelectViewController". This method handles the request before the tab is selected and that is exactly what you want so you can STOP the request before it ever happens... This way you don't have to save the current index you are on, pass it around and all that nonsense.

Then I am simply checking what tab WILL be selected (based on the view controller's title.

** Also: this is my code, change it as needed for your code. But the principals should remain. My "performSegueWithIdentifier" is actually a manual segue connected to my tab controller that opens in a modal. This code is working brilliant for me.


     if([[viewController title] isEqualToString:@"tellvc"])
         [self performSegueWithIdentifier:@"shareModelViewController" sender:Nil];
         return NO;
         return YES;

share|improve this answer
Nice clean approach to it. –  Michael Jan 30 at 19:24

Your Answer


