diff --git a/packages/flutter_tools/templates/create/ios.tmpl/Runner/AppDelegate.m b/packages/flutter_tools/templates/create/ios.tmpl/Runner/AppDelegate.m index d4cfa3ad4b5..8b9b8595a3c 100644 --- a/packages/flutter_tools/templates/create/ios.tmpl/Runner/AppDelegate.m +++ b/packages/flutter_tools/templates/create/ios.tmpl/Runner/AppDelegate.m @@ -30,4 +30,16 @@ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } +- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + [super touchesBegan:touches withEvent:event]; + + // Support scroll to top on status bar tap. By default, pass status bar taps + // to the application's root view controller for handling in Flutter. + UIViewController *viewController = + [UIApplication sharedApplication].keyWindow.rootViewController; + if ([viewController isKindOfClass:[FlutterViewController class]]) { + [(FlutterViewController*)viewController handleStatusBarTouches:event]; + } +} + @end