Skip to content

Commit ec933b9

Browse files
committed
Print log message when GH gets instantiated and torn down on iOS.
1 parent 08b6523 commit ec933b9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ios/RNGestureHandlerManager.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ - (void)registerRootViewIfNeeded:(UIView*)childView
118118
RCTRootView *rootView = (RCTRootView *)parent;
119119
UIView *rootContentView = rootView.contentView;
120120
if (rootContentView != nil && ![_rootViews containsObject:rootContentView]) {
121+
RCTLogInfo(@"[GESTURE HANDLER] Initialize gesture handler for root view %@", rootContentView);
121122
[_rootViews addObject:rootContentView];
122123
RNRootViewGestureRecognizer *recognizer = [RNRootViewGestureRecognizer new];
123124
recognizer.delegate = self;
@@ -144,6 +145,13 @@ - (void)gestureHandlerDidActivateInRootView:(UIView*)rootView
144145
touchHandler.enabled = YES;
145146
}
146147

148+
- (void)dealloc
149+
{
150+
if ([_rootViews count] > 0) {
151+
RCTLogInfo(@"[GESTURE HANDLER] Tearing down gesture handler registered for views %@", _rootViews);
152+
}
153+
}
154+
147155
#pragma mark Events
148156

149157
- (void)sendTouchEvent:(RNGestureHandlerEvent *)event

0 commit comments

Comments
 (0)