Permalink
Browse files

Merge pull request #566 from ralfvdz/patch-2

Fix URL navigation within modal view controller
  • Loading branch information...
2 parents ad32d4d + f266876 commit a07e9d65e92a270440f218ea4061003c397e7d29 @jwang jwang committed Jul 9, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/Three20UINavigator/Sources/TTBaseNavigator.m
@@ -933,6 +933,16 @@ - (UIViewController*)visibleViewController {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UIViewController*)topViewController {
UIViewController* controller = _rootViewController;
+
+ // Modal view controllers are presented (and stacked) from TTRootViewController
+ // Use its modalViewController when available as start to find top view controller
+ if (self.rootContainer != nil) {
+ UIViewController *modalRootController = [self.rootContainer rootViewController];
+ if (modalRootController.modalViewController) {
+ controller = modalRootController.modalViewController;
+ }
+ }
+
while (controller) {
UIViewController* child = controller.popupViewController;
if (!child || ![child canBeTopViewController]) {

0 comments on commit a07e9d6

Please sign in to comment.