mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Enqueue events at 60fps + profiling helpers
This commit is contained in:
@@ -1342,6 +1342,37 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView
|
||||
_nextLayoutAnimation = [[RCTLayoutAnimation alloc] initWithDictionary:config callback:callback];
|
||||
}
|
||||
|
||||
- (void)startOrResetInteractionTiming
|
||||
{
|
||||
RCT_EXPORT();
|
||||
|
||||
NSSet *rootViewTags = [_rootViewTags copy];
|
||||
[self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
|
||||
for (NSNumber *reactTag in rootViewTags) {
|
||||
RCTRootView *rootView = viewRegistry[reactTag];
|
||||
[rootView startOrResetInteractionTiming];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)endAndResetInteractionTiming:(RCTResponseSenderBlock)onSuccess
|
||||
onError:(RCTResponseSenderBlock)onError
|
||||
{
|
||||
RCT_EXPORT();
|
||||
|
||||
NSSet *rootViewTags = [_rootViewTags copy];
|
||||
[self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
|
||||
NSMutableDictionary *timingData = [[NSMutableDictionary alloc] init];
|
||||
for (NSNumber *reactTag in rootViewTags) {
|
||||
RCTRootView *rootView = viewRegistry[reactTag];
|
||||
if (rootView) {
|
||||
timingData[reactTag.stringValue] = [rootView endAndResetInteractionTiming];
|
||||
}
|
||||
}
|
||||
onSuccess(@[ timingData ]);
|
||||
}];
|
||||
}
|
||||
|
||||
static UIView *_jsResponder;
|
||||
|
||||
+ (UIView *)JSResponder
|
||||
|
||||
Reference in New Issue
Block a user