I have a UITabBarController with five view controllers in it. In one view controller, a button can be pressed to present a new ViewController, but the tabbar is covered. How can I present the controller and keep the tabbar visible?
            Asked
            
        
        
            Active
            
        
            Viewed 2,296 times
        
    2 Answers
3
            When you present something, it will cover entire screen.
The controller from where you want to present a new controller, make it as navigation controller rather keeping it as simple controller.
So, you can push the new controller on it rather than you present.
 
    
    
        Apurv
        
- 17,116
- 8
- 51
- 67
- 
                    then i can't use the modalTransitionStyle to have an animation on the transition.T.T – Henson Fang Dec 10 '15 at 08:05
- 
                    could someone helps me? – Henson Fang Dec 10 '15 at 08:28
- 
                    Refer this answer http://stackoverflow.com/questions/3838219/showing-pushviewcontroller-animation-look-like-presentmodalviewcontroller to provide transition style while pushing view controller. – Apurv Dec 10 '15 at 08:33
- 
                    I am having a navigation controller but still the view didnt occupy the space for tabBar – Angel F Syrus Jun 13 '19 at 05:40
-1
            
            
        [<presentingViewControllerInstance> setModalPresentationStyle:UIModalPresentationOverCurrentContext];
Use currentContext as presentation style for the presenting view controller before presenting. No need to create a navigation controller and push.
 
    
    
        Mukul More
        
- 554
- 2
- 5
- 18
 
    