Skip to content

Commit

Permalink
Avoid a never-disappearing splash screen if the engine came from some…
Browse files Browse the repository at this point in the history
…where else on iOS (#6834)

* Ignore multiple attemps to set splash screen, print warning
  • Loading branch information
dnfield authored Nov 14, 2018
1 parent 71ade82 commit 0d02877
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,19 @@ - (UIView*)splashScreenFromXib:(NSString*)name {
}

- (void)setSplashScreenView:(UIView*)view {
if (!view) {
// Special case: user wants to remove the splash screen view.
[self removeSplashScreenViewIfPresent];
} else if (_splashScreenView) {
FML_LOG(ERROR) << "Attempt to set the FlutterViewController's splash screen multiple times was "
"ignored. The FlutterViewController's splash screen can only be set once. "
"This condition can occur if a running FlutterEngine instance has been "
"passed into the FlutterViewController and a consumer later called "
"[FlutterViewController setSplashScreen:]. Setting the splash screen on a "
"FlutterViewController with an already running engine is not supported, as "
"the rasterizer will already be running by the time the view is shown.";
return;
}
_splashScreenView.reset([view retain]);
_splashScreenView.get().autoresizingMask =
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
Expand Down

0 comments on commit 0d02877

Please sign in to comment.