Files
react-native/React/Fabric/RCTSurfaceTouchHandler.h
T
Valentin Shergin 61cfa97067 Breaking a retain cycle between RCTSurfaceTouchHandler and RCTFabricSurface (another approach)
Summary:
This is a different approach to break the retain cycle: instead of detaching a view manually, we store a pointer to a view weakly.

I am working on some change that will make possible (and make use of it) to call `start` and `stop` on Surface objects mutiple times, so to make it happens we need to remove detaching from `stop` method.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D24041524

fbshipit-source-id: 700b13d715d2eb84d52bf3e51e0fd2896a55baf8
2020-10-01 09:38:28 -07:00

29 lines
652 B
Objective-C

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface RCTSurfaceTouchHandler : UIGestureRecognizer
/*
* Attaches (and detaches) a view to the touch handler.
* The receiver does not retain the provided view.
*/
- (void)attachToView:(UIView *)view;
- (void)detachFromView:(UIView *)view;
/*
* Offset of the attached view relative to the root component in points.
*/
@property (nonatomic, assign) CGPoint viewOriginOffset;
@end
NS_ASSUME_NONNULL_END