Skip to content

Commit

Permalink
fix: 修复对Window弹窗的指令解析问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
Hulk committed May 27, 2022
1 parent 663e294 commit 6da7816
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions iOS/DiDiPrism/Src/Category/UIView+PrismExtends.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@interface UIView (PrismExtends)

- (UIScrollView*)prism_UIScrollViewBelow;
- (UITableView*)prism_UITableViewBelow;
- (UICollectionView*)prism_UICollectionViewBelow;
- (UIViewController *)prism_viewController;
Expand Down
11 changes: 11 additions & 0 deletions iOS/DiDiPrism/Src/Category/UIView+PrismExtends.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@

@implementation UIView (PrismExtends)
#pragma mark - public method
- (UIScrollView*)prism_UIScrollViewBelow {
UIView *touchView = self;
do {
if ([touchView isKindOfClass:[UIScrollView class]]) {
return (UIScrollView*)touchView;
}
touchView = (UIView*)touchView.nextResponder;
} while (touchView && [touchView isKindOfClass:[UIView class]]);
return nil;
}

- (UITableView*)prism_UITableViewBelow {
UIView *touchView = self;
do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ - (UIView*)searchScrollViewCellWithScrollViewClassName:(NSString*)scrollViewClas
cellSectionOrOriginX:(CGFloat)cellSectionOrOriginX
cellRowOrOriginY:(CGFloat)cellRowOrOriginY
fromSuperView:(UIView*)superView {
// 类似于Window弹窗,此处的superView已经遍历到具体的cell了,需要回溯到父view。
if ([superView isKindOfClass:NSClassFromString(cellClassName)]) {
superView = [[superView prism_UIScrollViewBelow] superview] ?: superView;
}
if (!superView.subviews.count) {
return nil;
}
Expand Down

0 comments on commit 6da7816

Please sign in to comment.