Skip to content

Commit

Permalink
check base SDK version before using iOS7 code. fixes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
lobianco committed Oct 30, 2013
1 parent 7df3512 commit adbf151
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ALAlertBanner/ALAlertBanner.m
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ - (void)setInitialLayout {
case ALAlertBannerPositionTop:
initialYCoord = -heightForSelf;
if (isSuperviewKindOfWindow) initialYCoord += kStatusBarHeight;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
if (AL_IOS_7_OR_GREATER) {
id nextResponder = [self nextAvailableViewController:self];
if (nextResponder) {
Expand All @@ -546,6 +547,7 @@ - (void)setInitialLayout {
}
}
}
#endif
break;
case ALAlertBannerPositionBottom:
initialYCoord = superview.bounds.size.height;
Expand Down
2 changes: 2 additions & 0 deletions ALAlertBanner/ALAlertBannerManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ - (void)didRotate:(NSNotification *)note {
for (UIView *view in self.bannerViews) {
NSArray *topBanners = [view.alertBanners filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF.position == %i", ALAlertBannerPositionTop]];
CGFloat topYCoord = 0.f;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
if (AL_IOS_7_OR_GREATER && topBanners.count > 0) {
ALAlertBanner *firstBanner = (ALAlertBanner *)[topBanners objectAtIndex:0];
id nextResponder = [firstBanner nextAvailableViewController:firstBanner];
Expand All @@ -292,6 +293,7 @@ - (void)didRotate:(NSNotification *)note {
}
}
}
#endif
for (ALAlertBanner *alertBanner in [topBanners reverseObjectEnumerator]) {
[alertBanner updateSizeAndSubviewsAnimated:YES];
[alertBanner updatePositionAfterRotationWithY:topYCoord animated:YES];
Expand Down

0 comments on commit adbf151

Please sign in to comment.