Domanda

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];
È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top