Permalink
Browse files

read stackWidth after viewDidLoad #27

  • Loading branch information...
coreyfloyd committed Feb 28, 2012
1 parent 505e6ec commit d4c94529774f46418968a32c61edda2add3bfb3d
Showing with 3 additions and 0 deletions.
  1. +3 −0 PSStackedView/PSStackedViewController.m
@@ -919,10 +919,13 @@ - (void)pushViewController:(UIViewController *)viewController fromViewController
PSSVLog(@"pushing with index %d on stack: %@ (animated: %d)", [self.viewControllers count], viewController, animated);
viewController.view.height = [self screenHeight];
+ [viewController view]; //trigger viewDidload to ensure we get stack width
+
// get predefined stack width; query topViewController if we have a UINavigationController
CGFloat stackWidth = viewController.stackWidth;
if (stackWidth == 0.f && [viewController isKindOfClass:[UINavigationController class]]) {
UIViewController *topVC = ((UINavigationController *)viewController).topViewController;
+ [topVC view]; //trigger viewDidload to ensure we get stack width
stackWidth = topVC.stackWidth;
}
if (stackWidth > 0.f) {

0 comments on commit d4c9452

Please sign in to comment.