Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-20453] iOS: Fix LaunchScreen from being RootView #8151

Merged
merged 1 commit into from
Jul 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 13 additions & 3 deletions iphone/Classes/TiRootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,16 @@ -(void)loadView
UIView* theHost = nil;

if ([TiUtils isIOS8OrGreater]) {
#ifdef LAUNCHSCREEN_STORYBOARD
hostView = [[[UIStoryboard storyboardWithName:@"LaunchScreen" bundle:[NSBundle mainBundle]] instantiateInitialViewController] view];
#else
hostView = [[UIView alloc] initWithFrame:[rootView bounds]];
hostView.backgroundColor = [UIColor clearColor];

#ifdef LAUNCHSCREEN_STORYBOARD
UIView *launchScreenContainer = [[UIView alloc] initWithFrame:[rootView bounds]];
[launchScreenContainer addSubview:[[[UIStoryboard storyboardWithName:@"LaunchScreen" bundle:[NSBundle mainBundle]] instantiateInitialViewController] view]];
[hostView addSubview:launchScreenContainer];
[launchScreenContainer release];
#endif

hostView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[rootView addSubview:hostView];
theHost = hostView;
Expand Down Expand Up @@ -267,6 +271,12 @@ -(void)dismissDefaultImage
[defaultImageView removeFromSuperview];
RELEASE_TO_NIL(defaultImageView);
}

#ifdef LAUNCHSCREEN_STORYBOARD
if (hostView) {
[[[hostView subviews] objectAtIndex:0] removeFromSuperview];
}
#endif
}

- (UIImage*)defaultImageForOrientation:(UIDeviceOrientation) orientation resultingOrientation:(UIDeviceOrientation *)imageOrientation idiom:(UIUserInterfaceIdiom*) imageIdiom
Expand Down