How to call a viewcontrolller runtime

0

Friends I just need to open a ViewController, and I'm giving it silly, could help. Who can help .... Thanks. .

LoginViewController *tela2 =
[self.storyboard instantiateViewControllerWithIdentifier:@"login"];
[self presentViewController:tela2 animated:YES completion:nil];

    
asked by anonymous 01.08.2016 / 15:38

2 answers

1

With what you sent seems to be all right, the problem must be occurring where you are making that call, then.

If you are calling this method within:

override func viewDidLoad() {
    super.viewDidLoad()

}

Try running it within the following method:

override func viewWillAppear(animated: Bool) {
    super.viewWillAppear(animated)

}
    
12.08.2016 / 22:27
0

Resolved, just create a navigation controller.

    
01.08.2016 / 16:19