diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm index 225ab326bb6..d88b9bb548b 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm @@ -587,7 +587,11 @@ static BOOL _preparedOnce = NO; // from the web view plugin level. Right now we only observe this issue for // FlutterPlatformViewGestureRecognizersBlockingPolicyEager, but we should try it if a similar // issue arises for the other policy. - if (@available(iOS 18.2, *)) { + if (@available(iOS 26.0, *)) { + // This workaround does not work on iOS 26. + // TODO(hellohuanlin): find a solution for iOS 26, + // https://github.com/flutter/flutter/issues/175099. + } else if (@available(iOS 18.2, *)) { // This workaround is designed for WKWebView only. The 1P web view plugin provides a // WKWebView itself as the platform view. However, some 3P plugins provide wrappers of // WKWebView instead. So we perform DFS to search the view hierarchy (with a depth limit). diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm index e65dc4af721..20b4e2936c8 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm @@ -3198,7 +3198,14 @@ fml::RefPtr GetDefaultTaskRunner() { [(FlutterTouchInterceptingView*)touchInteceptorView blockGesture]; - if (@available(iOS 18.2, *)) { + BOOL shouldReAddDelayingRecognizer = NO; + if (@available(iOS 26.0, *)) { + // TODO(hellohuanlin): find a solution for iOS 26, + // https://github.com/flutter/flutter/issues/175099. + } else if (@available(iOS 18.2, *)) { + shouldReAddDelayingRecognizer = YES; + } + if (shouldReAddDelayingRecognizer) { // Since we remove and add back delayingRecognizer, it would be reordered to the last. XCTAssertEqual(touchInteceptorView.gestureRecognizers[0], forwardingRecognizer); XCTAssertEqual(touchInteceptorView.gestureRecognizers[1], delayingRecognizer); @@ -3261,7 +3268,14 @@ fml::RefPtr GetDefaultTaskRunner() { [(FlutterTouchInterceptingView*)touchInteceptorView blockGesture]; - if (@available(iOS 18.2, *)) { + BOOL shouldReAddDelayingRecognizer = NO; + if (@available(iOS 26.0, *)) { + // TODO(hellohuanlin): find a solution for iOS 26, + // https://github.com/flutter/flutter/issues/175099. + } else if (@available(iOS 18.2, *)) { + shouldReAddDelayingRecognizer = YES; + } + if (shouldReAddDelayingRecognizer) { // Since we remove and add back delayingRecognizer, it would be reordered to the last. XCTAssertEqual(touchInteceptorView.gestureRecognizers[0], forwardingRecognizer); XCTAssertEqual(touchInteceptorView.gestureRecognizers[1], delayingRecognizer);