From 2452603d317b603be2dfc216657a2d062f506c14 Mon Sep 17 00:00:00 2001 From: Wu Zhong Date: Thu, 28 Jul 2022 04:13:03 +0800 Subject: [PATCH] [iOS API breaking change] Make splashScreenView of FlutterViewController nullable (flutter/engine#34743) --- .../darwin/ios/framework/Headers/FlutterViewController.h | 4 +++- .../ios/framework/Source/FlutterViewControllerTest.mm | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h index 0e3b09f8e0..6c67715b66 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h @@ -203,8 +203,10 @@ FLUTTER_DARWIN_EXPORT * * The view used should be appropriate for multiple sizes; an autoresizing mask to * have a flexible width and height will be applied automatically. + * + * Set to nil to remove the splash screen view. */ -@property(strong, nonatomic) UIView* splashScreenView; +@property(strong, nonatomic, nullable) UIView* splashScreenView; /** * Attempts to set the `splashScreenView` property from the `UILaunchStoryboardName` from the diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm index c6b1a11669..69bfdc348c 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm @@ -1135,4 +1135,11 @@ extern NSNotificationName const FlutterViewControllerWillDealloc; XCTAssertTrue(interval_micros / 1000 < tolerance_millis, @"PointerData.time_stamp should be equal to NSProcessInfo.systemUptime"); } + +- (void)testSplashScreenViewCanSetNil { + FlutterViewController* flutterViewController = + [[FlutterViewController alloc] initWithProject:nil nibName:nil bundle:nil]; + [flutterViewController setSplashScreenView:nil]; +} + @end