Search code examples
iosclassviewoverlayuitabcontroller

Call another class in IOS


I'm new on IOS platform and after study a little about how does it works, i had one doubt about how to call a new class/view and overlay the current view when a button is pressed. In android i do:

Intent intent = new Intent(a.class, b.class);
startActivity(intent);

Searching on internet, i noticed that i have to use navigation bars to do it. I start an app with tab bar controller and putted a navigation controller. I used the code below:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
UIViewController *myController = [storyboard instantiateViewControllerWithIdentifier:@"Dicas"];
[self.navigationController pushViewController: myController animated:YES];

and the return: enter image description here There is a way to overlay the current view? I always have to use navigation bars to call another class (use bottom e upper controllers will make my app ugly)?


Solution

  • To hide the navigation bar:

    [[self navigationController] setNavigationBarHidden:YES animated:YES];
    

    To hide tab bar:

    yourViewController.hidesBottomBarWhenPushed = YES;