Reputation: 8303
I've tried many combinations of doing this from the app delegate, the presenting view controller's viewDidLoad
, with and without delay, with and without animation.
But either the user can see the presenting view controller for a moment, or the modal doesn't get presented.
How can this be achieved?
Upvotes: 10
Views: 2533
Reputation: 2019
Tried code below with storyboard, app starts with modal view controller:
AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self.window makeKeyAndVisible];
[self.window.rootViewController performSegueWithIdentifier:@"modalSegue" sender:self];
return YES;
}
Segue configuration from start view controller to modal view controller:
Upvotes: 6
Reputation: 17556
What if your inititalViewController had a picture of your launch image over it.
@property (nonatomic, weak) IBOutlet UIImageView *launchImage;
Set the launch image before the view appears.
- (void)viewWillAppear
{
self.launchImage.image = [self launchImage];
}
Here's a link to get the launch image.
Then when you present the modal view controller, remove the launch image.
[self presentViewController:vc animated:NO completion:^{
[self.launchImage removeFromSuperview];
}];
Upvotes: 1