(client_ios) Update Descriptors
Summary: Similar to D21040424 and D21040426. Reviewed By: Andrey-Mishanin Differential Revision: D21335955 fbshipit-source-id: 5e8326915e54647c77fb241ad2ed4eaa55d0cfe2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
367dbeee8c
commit
f4c209bc1c
@@ -184,16 +184,17 @@ static std::vector<std::pair<NSString*, SKSubDescriptor>>& subDescriptors() {
|
||||
return YES;
|
||||
},
|
||||
[&](std::vector<SKComponentLayoutWrapper*> children) -> BOOL {
|
||||
BOOL continueTouch = NO;
|
||||
for (auto it = children.rbegin(); it != children.rend(); ++it) {
|
||||
SKComponentLayoutWrapper* wrapper = *it;
|
||||
CGRect frame = {.origin = wrapper.position, .size = wrapper.size};
|
||||
if ([touch containedIn:frame]) {
|
||||
NSUInteger index = std::distance(children.begin(), it.base()) - 1;
|
||||
[touch continueWithChildIndex:index withOffset:wrapper.position];
|
||||
return YES;
|
||||
continueTouch = YES;
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
return continueTouch;
|
||||
});
|
||||
if (!didContinueTouch) {
|
||||
[touch finish];
|
||||
|
||||
@@ -72,16 +72,19 @@
|
||||
return; // -children will return garbage if invoked on nil
|
||||
}
|
||||
const auto& children = node.children;
|
||||
bool finish = true;
|
||||
for (auto it = children.rbegin(); it != children.rend(); ++it) {
|
||||
SKComponentLayoutWrapper* child = *it;
|
||||
CGRect frame = {.origin = child.position, .size = child.size};
|
||||
if ([touch containedIn:frame]) {
|
||||
NSUInteger index = std::distance(children.begin(), it.base()) - 1;
|
||||
[touch continueWithChildIndex:index withOffset:child.position];
|
||||
return;
|
||||
finish = false;
|
||||
}
|
||||
}
|
||||
[touch finish];
|
||||
if (finish) {
|
||||
[touch finish];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)matchesQuery:(NSString*)query forNode:(SKComponentMountedView*)node {
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
}
|
||||
|
||||
- (void)hitTest:(SKTouch*)touch forNode:(UIApplication*)node {
|
||||
bool finish = true;
|
||||
for (NSInteger index = [self childCountForNode:node] - 1; index >= 0;
|
||||
index--) {
|
||||
UIWindow* child = [self childForNode:node atIndex:index];
|
||||
@@ -43,11 +44,12 @@
|
||||
|
||||
if ([touch containedIn:child.frame]) {
|
||||
[touch continueWithChildIndex:index withOffset:child.frame.origin];
|
||||
return;
|
||||
finish = false;
|
||||
}
|
||||
}
|
||||
|
||||
[touch finish];
|
||||
if (finish) {
|
||||
[touch finish];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray<UIWindow*>*)visibleChildrenForNode:(UIApplication*)node {
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
}
|
||||
|
||||
- (void)hitTest:(SKTouch*)touch forNode:(UIScrollView*)node {
|
||||
bool finish = true;
|
||||
for (NSInteger index = [self childCountForNode:node] - 1; index >= 0;
|
||||
index--) {
|
||||
id<NSObject> childNode = [self childForNode:node atIndex:index];
|
||||
@@ -75,11 +76,13 @@
|
||||
|
||||
if ([touch containedIn:frame]) {
|
||||
[touch continueWithChildIndex:index withOffset:frame.origin];
|
||||
return;
|
||||
finish = false;
|
||||
}
|
||||
}
|
||||
|
||||
[touch finish];
|
||||
if (finish) {
|
||||
[touch finish];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -497,6 +497,7 @@ return dataMutations;
|
||||
}
|
||||
|
||||
- (void)hitTest:(SKTouch*)touch forNode:(UIView*)node {
|
||||
bool finish = true;
|
||||
for (NSInteger index = [self childCountForNode:node] - 1; index >= 0;
|
||||
index--) {
|
||||
id<NSObject> childNode = [self childForNode:node atIndex:index];
|
||||
@@ -518,11 +519,13 @@ return dataMutations;
|
||||
|
||||
if ([touch containedIn:viewForNode.frame]) {
|
||||
[touch continueWithChildIndex:index withOffset:viewForNode.frame.origin];
|
||||
return;
|
||||
finish = false;
|
||||
}
|
||||
}
|
||||
|
||||
[touch finish];
|
||||
if (finish) {
|
||||
[touch finish];
|
||||
}
|
||||
}
|
||||
|
||||
static void initEnumDictionaries() {
|
||||
|
||||
Reference in New Issue
Block a user