Skip to content

Instantly share code, notes, and snippets.

@DickyT
Created January 11, 2020 09:27
Show Gist options
  • Save DickyT/a46439a8cb3e62f73a9b9787401ed14d to your computer and use it in GitHub Desktop.
Save DickyT/a46439a8cb3e62f73a9b9787401ed14d to your computer and use it in GitHub Desktop.
Send touch events to WKWebKit from other UIView
NSValue *value = [webView valueForKey:@"_contentView"];
WKContentView *content = [value nonretainedObjectValue];
UIWebTouchEventsGestureRecognizer *gesture = [[UIWebTouchEventsGestureRecognizer alloc] initWithTarget:content action:@selector(_webTouchEventsRecognized:) touchDelegate:content];
[gesture setDelegate:content];
[forwardView addGestureRecognizer:gesture];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment