Permalink
Browse files

Merge pull request #25 from natanrolnik/master

Improved reliability to BlockTextpromptAlertView
  • Loading branch information...
2 parents 4999c4a + c3797b7 commit e3276bfc487b9d6f8cae2d7363b16be67c95c15a @gpambrozio committed May 20, 2012
@@ -285,7 +285,9 @@ - (void)show
center.y -= kAlertViewBounce;
_view.center = center;
}
- completion:nil];
+ completion:^(BOOL finished) {
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"AlertViewFinishedAnimations" object:nil];
+ }];
}];
[self retain];
@@ -83,12 +83,13 @@ - (void)show {
[super show];
- [self.textField performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0.5];
+ [[NSNotificationCenter defaultCenter] addObserver:textField selector:@selector(becomeFirstResponder) name:@"AlertViewFinishedAnimations" object:nil];
}
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated {
[super dismissWithClickedButtonIndex:buttonIndex animated:animated];
+ [[NSNotificationCenter defaultCenter] removeObserver:textField];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
}

0 comments on commit e3276bf

Please sign in to comment.