Skip to content

Commit

Permalink
Cancel the previous hideAnimated if the view was moved to a nil sup…
Browse files Browse the repository at this point in the history
…erview. This fixes a crash if the view is removed before the hiding begins.
  • Loading branch information
kgn committed Jul 4, 2012
1 parent 3075ef2 commit 2c37a93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion GCDiscreetNotificationView/GCDiscreetNotificationView.m
Expand Up @@ -409,7 +409,10 @@ - (void) changePropretyAnimatedWithKeys:(NSArray*) keys values:(NSArray*) values
#pragma mark - UIView subclass

- (void)willMoveToSuperview:(UIView *)newSuperview {
if (newSuperview == nil) self.animationDict = nil;
if (newSuperview == nil) {
self.animationDict = nil;
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hideAnimated) object:nil];
}
}

@end

0 comments on commit 2c37a93

Please sign in to comment.