Skip to content

Commit

Permalink
fix(ios): fix indent error
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyunong committed Dec 2, 2024
1 parent 8a780e0 commit 065c15a
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions renderer/native/ios/renderer/component/view/HippyViewManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -188,29 +188,29 @@ - (void)measureInAppWindow:(NSNumber *)componentTag
HIPPY_EXPORT_METHOD(getViewTagByLocation:(nonnull NSNumber *)componentTag
params:(NSDictionary *__nonnull)params
callback:(HippyPromiseResolveBlock)callback) {
[self.bridge.uiManager addUIBlock:^(__unused HippyUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
NSMutableDictionary *locationDict = [NSMutableDictionary dictionaryWithDictionary:@{
HippyTagKey: @(InvalidTag),
[self.bridge.uiManager addUIBlock:^(__unused HippyUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
NSMutableDictionary *locationDict = [NSMutableDictionary dictionaryWithDictionary:@{
HippyTagKey: @(InvalidTag),
}];
UIView *view = viewRegistry[componentTag];
if (view == nil) {
callback(locationDict);
return;
}
UIView *rootView = viewRegistry[view.rootTag];
if (rootView == nil) {
callback(locationDict);
return;
}
double locationX = [params[HippyXOnScreenKey] doubleValue];
double locationY = [params[HippyYOnScreenKey] doubleValue];
UIView* hitView = [rootView hitTest:{locationX, locationY} withEvent:nil];
// TODO: The hitView may not a hippy view (such as a sub native view). Should trace to hippy view.
if (hitView.hippyTag) {
[locationDict setObject:hitView.hippyTag forKey:HippyTagKey];
}
callback(@[locationDict]);
}];
UIView *view = viewRegistry[componentTag];
if (view == nil) {
callback(locationDict);
return;
}
UIView *rootView = viewRegistry[view.rootTag];
if (rootView == nil) {
callback(locationDict);
return;
}
double locationX = [params[HippyXOnScreenKey] doubleValue];
double locationY = [params[HippyYOnScreenKey] doubleValue];
UIView* hitView = [rootView hitTest:{locationX, locationY} withEvent:nil];
// TODO: The hitView may not a hippy view (such as a sub native view). Should trace to hippy view.
if (hitView.hippyTag) {
[locationDict setObject:hitView.hippyTag forKey:HippyTagKey];
}
callback(@[locationDict]);
}];
}

HIPPY_EXPORT_METHOD(getLocationOnScreen:(nonnull NSNumber *)componentTag
Expand Down

0 comments on commit 065c15a

Please sign in to comment.