Skip to content

Commit

Permalink
added compile conditions for ios7
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaschengdev committed Oct 11, 2013
1 parent d9d3a7f commit 87fc511
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions WYPopoverController/WYPopoverController.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ - (void)setEmbedInPopover:(BOOL)value

- (void)sizzled_pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if (self.isEmbedInPopover && WY_IS_IOS_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
if (self.isEmbedInPopover)
{
#ifdef WY_BASE_SDK_7_ENABLED
viewController.edgesForExtendedLayout = UIRectEdgeNone;
#endif
}

[self sizzled_pushViewController:viewController animated:animated];
Expand Down Expand Up @@ -1598,9 +1600,11 @@ - (void)setPopoverNavigationBarBackgroundImage
UINavigationController *navigationController = (UINavigationController *)viewController;
navigationController.embedInPopover = YES;

if (WY_IS_IOS_GREATER_THAN_OR_EQUAL_TO(@"7.0") && [navigationController viewControllers] && [[navigationController viewControllers] count] > 0)
if ([navigationController viewControllers] && [[navigationController viewControllers] count] > 0)
{
#ifdef WY_BASE_SDK_7_ENABLED
[(UIViewController *)[[navigationController viewControllers] objectAtIndex:0] setEdgesForExtendedLayout:UIRectEdgeNone];
#endif
}

[navigationController.navigationBar setBackgroundImage:[UIImage imageWithColor:[UIColor clearColor]] forBarMetrics:UIBarMetricsDefault];
Expand Down

0 comments on commit 87fc511

Please sign in to comment.