diff --git a/GKAchievementNotification.m b/GKAchievementNotification.m index be6d13c..f0394c6 100644 --- a/GKAchievementNotification.m +++ b/GKAchievementNotification.m @@ -16,6 +16,7 @@ @interface GKAchievementNotification(private) - (void)animationInDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context; - (void)animationOutDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context; - (void)delegateCallback:(SEL)selector withObject:(id)object; +- (CGRect)adjustedFrameEnd; @end @@ -46,6 +47,15 @@ - (void)delegateCallback:(SEL)selector withObject:(id)object } } +- (CGRect)adjustedFrameEnd { + CGRect frameEnd = kGKAchievementFrameEnd; + UIApplication *application = [UIApplication sharedApplication]; + if (!application.statusBarHidden) { + frameEnd.origin.y += application.statusBarFrame.size.height; + } + return frameEnd; +} + @end #pragma mark - @@ -174,7 +184,7 @@ - (void)animateIn [UIView setAnimationDelegate:self]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationDidStopSelector:@selector(animationInDidStop:finished:context:)]; - self.frame = kGKAchievementFrameEnd; + self.frame = [self adjustedFrameEnd]; [UIView commitAnimations]; }