我使用UIStoryboard中的segue在我的代碼中加載視圖控制器。基於少數用戶選擇的選項,我然後使用動畫隱藏或顯示UI控件。它一切正常。Modal View正在重置我的現有視圖控制器
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil];
SigningViewController *signingVC = (SigningViewController *)[storyboard instantiateViewControllerWithIdentifier:@"SigningViewController"];
signingVC.object = self;
signingVC.signatureProperty = @"employeeSignature";
signingVC.startDate = self.startDate;
signingVC.endDate = self.endDate;
[self presentViewController:signingVC animated:YES completion:nil];
此代碼時觸發如預期,除了一兩件事都發生了:所有的自定義
- (void)showComments {
NSLog(@"Show Comments");
_commentsTextView.hidden = NO;
_commentsTextView.frame = CGRectMake(435, 266, 475, 134);
[UIView animateWithDuration:1 animations:^{
_commentsTextView.alpha = 1;
_signatureButton.frame = CGRectMake(435, 420, 475, 134);
_cancelButton.frame = CGRectMake(568, 581, 100, 44);
_finishedButton.frame = CGRectMake(676, 581, 100, 44);
}];
}
然後我用下面的代碼呈現在UIStoryboard創建一個視圖控制器隱藏或顯示UI控件的動畫恢復。就好像通過調用presentViewController方法,它正在從UIStoryboard重繪我現有的視圖。
有沒有辦法讓它在模態顯示新視圖之前重新繪製/重新加載我的現有視圖?