Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top