Skip to content

Commit 379d9d4

Browse files
vincentriemerfacebook-github-bot
authored andcommitted
Refactor PointerEvent emitting into its own gesture recognizer
Summary: Changelog: [iOS][Internal] - Refactor PointerEvent emitting into its own gesture recognizer In doing some exploration of a full e2e implementation of the click event I found pretty early on the necessity of addressing the pointerCancel on scroll functionality which, to implement properly without degrading the existing touch gesture handler — involves extracting all the pointer event handling code written so far into its own gesture handler so it can "fail" (when a scroll view wants to take priority) without affecting the existing touch handlers. This diff is only a refactor and doesn't add/change any new functionality. allow-large-files Reviewed By: sammy-SC Differential Revision: D43372806 fbshipit-source-id: e16f75121fd121d3f82ab43cfc6fab0629654f26
1 parent b2fda3e commit 379d9d4

File tree

5 files changed

+965
-623
lines changed

5 files changed

+965
-623
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
#import <UIKit/UIKit.h>
9+
10+
NS_ASSUME_NONNULL_BEGIN
11+
12+
@interface RCTSurfacePointerHandler : UIGestureRecognizer
13+
14+
/*
15+
* Attaches (and detaches) a view to the touch handler.
16+
* The receiver does not retain the provided view.
17+
*/
18+
- (void)attachToView:(UIView *)view;
19+
- (void)detachFromView:(UIView *)view;
20+
21+
/*
22+
* Offset of the attached view relative to the root component in points.
23+
*/
24+
@property (nonatomic, assign) CGPoint viewOriginOffset;
25+
26+
@end
27+
28+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)