Reputation: 313
I am building an App and Deployment Target back to iOS 7 (so Launch Screen File in xCode6 not work for me)
The issue is App will have launch images which appear at the beginning. After AppDelegate Finished and loading a NavigationView as rootViewController (defined in Storyboard). I added a new subview (in ViewDidLoad) with same Launch Image with UIActivityIndicatorView (so it keep smooth and telling user it is working).
The problem is after AppDelegate finished, it will show the View of RootViewController and then show 'Launch image with UIActivityIndicatorView'. Although it show very fast, it look like the screen flash and it affecting user experience.
What should I do to avoid it? Thank you
- (void)viewDidLoad
{
[super viewDidLoad];
//Create a simple UIView with BG img and UIActivityIndicator
dispatch_sync(dispatch_get_main_queue(),^{
[self popLoadingScreenWithType:0];
});
//...something else for App execute
}
Upvotes: 0
Views: 147
Reputation: 4035
What you can do is keep the Splash screen view as the main view in the view controller and then hide it after some time delay.
[self performSelector:@selector(loadMainView) withObject:nil afterDelay:2.0];
In this loadMainView method --> hide the splash screen and then show Main view.
Alternatively, you can set a timer and create the same effect
NSTime *firstScreenTimer = [NSTimer scheduledTimerWithTimeInterval:2.2 target:self selector:@selector(loadMainView) userInfo:nil repeats:NO];
Upvotes: 1