Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Search the whole navigation hierarchy for a FlipBoardNavigationController instance #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions Classes/FlipBoardNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceive
}

- (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
return YES;
return NO;
}

#pragma mark - Handle Panning Activity
Expand Down Expand Up @@ -328,18 +328,14 @@ @implementation UIViewController (FlipBoardNavigationController)

- (FlipBoardNavigationController *)flipboardNavigationController
{

if([self.parentViewController isKindOfClass:[FlipBoardNavigationController class]]){
return (FlipBoardNavigationController*)self.parentViewController;
}
else if([self.parentViewController isKindOfClass:[UINavigationController class]] &&
[self.parentViewController.parentViewController isKindOfClass:[FlipBoardNavigationController class]]){
return (FlipBoardNavigationController*)[self.parentViewController parentViewController];
}
else{
return nil;
UIViewController *parentViewController = self.parentViewController;
while (parentViewController != nil) {
if([parentViewController isKindOfClass:[FlipBoardNavigationController class]]){
return (FlipBoardNavigationController *)parentViewController;
}
parentViewController = parentViewController.parentViewController;
}

return nil;
}


Expand Down