Skip to content

Commit

Permalink
Fixed bug related to invalid view hierarchy exception
Browse files Browse the repository at this point in the history
  • Loading branch information
werner77 committed Jan 25, 2016
1 parent b83d532 commit 35f114b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Classes/Popover/WEPopoverController.m
Expand Up @@ -459,16 +459,16 @@ - (CGRect)fillRectForView:(WETouchableView *)view {

@implementation WEPopoverController(Private)

- (BOOL)isView:(UIView *)v1 inSameHierarchyAsView:(UIView *)v2 {
BOOL inViewHierarchy = NO;
while (v1 != nil) {
if (v1 == v2) {
inViewHierarchy = YES;
break;
}
v1 = v1.superview;
- (UIView *)topMostAncestorForView:(UIView *)view {
UIView *v = view;
while (v.superview != nil) {
v = v.superview;
}
return inViewHierarchy;
return v;
}

- (BOOL)isView:(UIView *)v1 inSameHierarchyAsView:(UIView *)v2 {
return [self topMostAncestorForView:v1] == [self topMostAncestorForView:v2];
}

- (UIView *)keyViewForView:(UIView *)theView {
Expand Down

0 comments on commit 35f114b

Please sign in to comment.