我正在显示一个错误的登录屏幕,例如:
_loginViewController.error = error;
[_navigationController presentModalController: _loginViewController
animated: YES];
在 LoginViewController 中,我想将错误消息滑到屏幕上,如下所示:
- (void)showErrorAnimated: (BOOL)animated;
{
_errorLabel.text = [_error localizedDescription];
[UIView beginAnimations: @"showError"
context: NULL];
CGRect frame = [_errorView frame];
frame.origin.y = 0; // starts at -frame.size.height
[_errorView setFrame: frame];
[UIView commitAnimations];
}
但我不知道如何调用它来匹配视图控制器完成滑动到屏幕顶部的时间,从presentModalController:animated:
.
我怎样才能让这个时间工作?