문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top