From 265d0345c74b6d52e1e12ac7277c3e2c81cbcba8 Mon Sep 17 00:00:00 2001 From: Shawn Wall Date: Wed, 17 Jul 2013 22:41:48 -0400 Subject: [PATCH] Fix landscape shadow issue on initial launch The view doesn't yet no it's bounds in initForController:shadow: so we must call setupShadow in layoutSubviews. --- .../Controller/PKRevealControllerContainerView.m | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/PKRevealController/Controller/PKRevealControllerContainerView.m b/PKRevealController/Controller/PKRevealControllerContainerView.m index ecdbb5b..a929d49 100644 --- a/PKRevealController/Controller/PKRevealControllerContainerView.m +++ b/PKRevealController/Controller/PKRevealControllerContainerView.m @@ -35,10 +35,6 @@ - (id)initForController:(UIViewController *)controller shadow:(BOOL)hasShadow if (self != nil) { self.viewController = controller; - if (hasShadow) - { - [self setupShadow]; - } self.shadow = hasShadow; } @@ -64,6 +60,9 @@ - (void)layoutSubviews { [super layoutSubviews]; // layout controller view + if (self.shadow && !self.layer.shadowPath) { + [self setupShadow]; + } self.viewController.view.frame = self.viewController.view.bounds; } @@ -109,4 +108,4 @@ - (void)disableUserInteractionForContainedView [self.viewController.view setUserInteractionEnabled:NO]; } -@end \ No newline at end of file +@end