Commit 2bbc0283 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Add touchesBegan handler to iOS AppDelegate template (#7822)

By default, pass status bar taps to the root view controller in
generated Flutter apps. Developers should customise as necesary if they
later create one or more alternate FlutterViewControllers that they'd
like to forward these to.
parent d2a1e125
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment