Auto segue when rootViewControl loads
-
21-12-2019 - |
Pregunta
I have a Navigation Controller in a storyboard set as the initial view. It calls one viewController
, lets call it inititalViewCon
. I want initialViewCon
to modally segue to another viewController
as soon as it loads.
So it would open the app, go to initialViewCon
and then have a modal segue pop up. How would I accomplish this?
Solución
I subclassed the UIViewController
, the second one, which I know is against Apple's guidelines.
I added this method to the subclass:
- (IBAction)doneButton:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}
It's kind of strange that you can initiate a modal segue from a storyboard but there's no way to dismiss it without subclassing the viewController
.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow