A
A
Artem Lisovsky2015-04-30 09:40:15
Objective-C
Artem Lisovsky, 2015-04-30 09:40:15

How to navigate to TabBarController from Viewcontroller?

Got stuck with this problem:
There is a ViewController with an entry point. I want that when the button is pressed, the tab controller opens joxi.ru/4zANjVlHjnlaA9
I put the code on the button

- (IBAction)goAsGuest:(id)sender {
    TabsController *tab = [[TabsController alloc] init];
    [tab setModalPresentationStyle:UIModalPresentationFullScreen];
    [tab setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
    
    
    ReviewsViewController* vc1 = [[ReviewsViewController alloc] init];
    
    NSArray* controllers = [NSArray arrayWithObjects:vc1, nil];
    tab.viewControllers = controllers;
    
    [self presentViewController:tab animated:YES completion:NULL];
}

But when I start after pressing the button, I do not see my "subcontrollers" - joxi.ru/JMAj9lXCkDvQ2e only a black screen.
Moreover, if you put the entry point on the tabs controller, then everything works fine, but with a similar scheme - a cant. Tried also to do through Appdelegate, the problem remained. There is a feeling that I am missing something. what?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Artem Lisovsky, 2015-04-30
@torrie

Implemented using segue with the modal parameter from the button to the tab controller.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question