| Flutter iOS Embedder |

Instance Methods | Properties | List of all members
FlutterTouchInterceptingView Class Reference

`#import <FlutterPlatformViews_Internal.h>`

Inheritance diagram for FlutterTouchInterceptingView:

## Instance Methods
(instancetype) | - initWithEmbeddedView:platformViewsController:gestureRecognizersBlockingPolicy:
(void) | - releaseGesture
(void) | - blockGesture
(UIView *) | - embeddedView
(id) | - accessibilityContainer

## Properties
id | flutterAccessibilityContainer

## Detailed Description

Definition at line 138 of file FlutterPlatformViews_Internal.h.

## Method Documentation

## ◆ accessibilityContainer

- (id) accessibilityContainer |  |  |

Provided by category FlutterTouchInterceptingView(Tests).

## ◆ blockGesture

- (void) blockGesture |  |  |

Definition at line 556 of file FlutterPlatformViews_Internal.mm.

556 {
557 switch (_blockingPolicy) {
558 case FlutterPlatformViewGestureRecognizersBlockingPolicyEager:
559 // We block all other gesture recognizers immediately in this policy.
560 self.delayingRecognizer.state = UIGestureRecognizerStateEnded;
561
562 // On iOS 18.2, WKWebView's internal recognizer likely caches the old state of its blocking
563 // recognizers (i.e. delaying recognizer), resulting in non-tappable links. See
564 // https://github.com/flutter/flutter/issues/158961. Removing and adding back the delaying
565 // recognizer solves the problem, possibly because UIKit notifies all the recognizers related
566 // to (blocking or blocked by) this recognizer. It is not possible to inject this workaround
567 // from the web view plugin level. Right now we only observe this issue for
568 // FlutterPlatformViewGestureRecognizersBlockingPolicyEager, but we should try it if a similar
569 // issue arises for the other policy.
570 if (@available(iOS 18.2, *)) {
571 if ([self.embeddedView isKindOfClass:[WKWebView class]]) {
572 [self removeGestureRecognizer:self.delayingRecognizer];
573 [self addGestureRecognizer:self.delayingRecognizer];
574 }
575 }
576
577 break;
578 case FlutterPlatformViewGestureRecognizersBlockingPolicyWaitUntilTouchesEnded:
579 if (self.delayingRecognizer.touchedEndedWithoutBlocking) {
580 // If touchesEnded of the `DelayingGesureRecognizer` has been already invoked,
581 // we want to set the state of the `DelayingGesureRecognizer` to
582 // `UIGestureRecognizerStateEnded` as soon as possible.
583 self.delayingRecognizer.state = UIGestureRecognizerStateEnded;
584 } else {
585 // If touchesEnded of the `DelayingGesureRecognizer` has not been invoked,
586 // We will set a flag to notify the `DelayingGesureRecognizer` to set the state to
587 // `UIGestureRecognizerStateEnded` when touchesEnded is called.
588 self.delayingRecognizer.shouldEndInNextTouchesEnded = YES;
589 }
590 break;
591 default:
592 break;
593 }
594 }

References embeddedView, FlutterPlatformViewGestureRecognizersBlockingPolicyEager, and FlutterPlatformViewGestureRecognizersBlockingPolicyWaitUntilTouchesEnded.

## ◆ embeddedView

- (UIView*) embeddedView |  |  |

Referenced by blockGesture, and initWithEmbeddedView:platformViewsController:gestureRecognizersBlockingPolicy:.

## ◆ initWithEmbeddedView:platformViewsController:gestureRecognizersBlockingPolicy:

- (instancetype) initWithEmbeddedView: |  | (UIView*) | embeddedView
platformViewsController: |  | (fml::WeakPtr<flutter::PlatformViewsController>) | platformViewsController
gestureRecognizersBlockingPolicy: |  | (FlutterPlatformViewGestureRecognizersBlockingPolicy) | blockingPolicy

Definition at line 522 of file FlutterPlatformViews_Internal.mm.

522 :(UIView*)embeddedView
523 platformViewsController:
524 (fml::WeakPtr<flutter::PlatformViewsController>)platformViewsController
525 gestureRecognizersBlockingPolicy:
526 (FlutterPlatformViewGestureRecognizersBlockingPolicy)blockingPolicy {
527 self = [super initWithFrame:embeddedView.frame];
528 if (self) {
529 self.multipleTouchEnabled = YES;
530 _embeddedView = embeddedView;
531 embeddedView.autoresizingMask =
532 (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
533
534 [self addSubview:embeddedView];
535
536 ForwardingGestureRecognizer* forwardingRecognizer =
537 [[ForwardingGestureRecognizer alloc] initWithTarget:self
538 platformViewsController:platformViewsController];
539
540 _delayingRecognizer =
541 [[FlutterDelayingGestureRecognizer alloc] initWithTarget:self
542 action:nil
543 forwardingRecognizer:forwardingRecognizer];
544 _blockingPolicy = blockingPolicy;
545
546 [self addGestureRecognizer:_delayingRecognizer];
547 [self addGestureRecognizer:forwardingRecognizer];
548 }
549 return self;
550 }

References embeddedView.

## ◆ releaseGesture

- (void) releaseGesture |  |  |

Definition at line 552 of file FlutterPlatformViews_Internal.mm.

552 {
553 self.delayingRecognizer.state = UIGestureRecognizerStateFailed;
554 }

## Property Documentation

## ◆ flutterAccessibilityContainer

- (id) flutterAccessibilityContainer
| read write nonatomic retain

Definition at line 155 of file FlutterPlatformViews_Internal.h.

The documentation for this class was generated from the following files:

- shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h
- shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm

-[FlutterTouchInterceptingView embeddedView]
UIView * embeddedView()
FlutterPlatformViewGestureRecognizersBlockingPolicyWaitUntilTouchesEnded
@ FlutterPlatformViewGestureRecognizersBlockingPolicyWaitUntilTouchesEnded
Definition: FlutterPlugin.h:269
FlutterDelayingGestureRecognizer
Definition: FlutterPlatformViews_Internal.h:169
ForwardingGestureRecognizer
Definition: FlutterPlatformViews_Internal.h:196
FlutterPlatformViewGestureRecognizersBlockingPolicyEager
@ FlutterPlatformViewGestureRecognizersBlockingPolicyEager
Definition: FlutterPlugin.h:261
FlutterPlatformViewGestureRecognizersBlockingPolicy
FlutterPlatformViewGestureRecognizersBlockingPolicy
Definition: FlutterPlugin.h:252