I want to navigate between the ViewController of an app by clicking a button and switching from one to another for example. I wanted to run this directly in the viewDidLoad of the ViewController1, if the user has already registered, I will send it to the secondView.
It would look something like this:
ViewController1
-(void)viewDidLoad{
if(_cadastrado isEqualToString:@"1"){
UIViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"segundaView"];
[self presentViewController:viewController animated:YES completion:nil];
}
}
The method when I run out of viewDidLoad works perfectly, but when I try to run it inside the viewDidLoad I can not.