Pergunta

I have this code, and every time that I'm using it, the viewDidLoad of the destination view is called twice.

why it's happening?

Destination *myDestination = [self.storyboard instantiateViewControllerWithIdentifier:@"destination "];
MyCustomSegue *segue = [[MyCustomSegue alloc] initWithIdentifier:@"CustomSegue" source:self  destination : myDestination];
[segue perform];
Foi útil?

Solução

I think you can achieve this by calling method presentViewController: animated: completion:; e.g

Destination *myDestination = [self.storyboard instantiateViewControllerWithIdentifier:@"destination "];
[self presentViewController:myDestination animated:YES completion:nil];

I hope this will help you out.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top