Я использую кучу пользовательских переходов для перехода от одного представления контроллера представления к другому, используя:
[self performSegueWithIdentifier:@"createTeamAccountSegue" sender:self];
Мой вопрос: автоматически ли уничтожаются предыдущие представления в iOS5 и 6?
Мне все время приходится создавать пользовательские переходы, чтобы перейти к следующему представлению, а затем создавать еще одну новую анимацию перехода в обратном порядке, чтобы вернуться к последнему представлению. Пока они не продолжают накапливаться, тогда все должно быть в порядке, верно?
РЕДАКТИРОВАТЬ: я, вероятно, должен показать вам общий макет того, как выглядит мой пользовательский класс UIStoryboardSegue:
- (void) perform {
UIViewController *sourceViewController = (UIViewController *) self.sourceViewController;
UIViewController *destinationViewController = (UIViewController *) self.destinationViewController;
UIView *parent = sourceViewController.view.superview;
[parent addSubview:destinationViewController.view];
[parent sendSubviewToBack:destinationViewController.view];
sourceViewController.view.layer.masksToBounds = NO;
sourceViewController.view.layer.cornerRadius = 8; // if you like rounded corners
sourceViewController.view.layer.shadowOffset = CGSizeMake(0,0);
sourceViewController.view.layer.shadowRadius = 10;
sourceViewController.view.layer.shadowOpacity = 1;
destinationViewController.view.frame = CGRectMake(0, 20, destinationViewController.view.frame.size.width, destinationViewController.view.frame.size.height);
sourceViewController.view.frame = CGRectMake(0, 20, sourceViewController.view.frame.size.width, sourceViewController.view.frame.size.height);
[UIView animateWithDuration:.3 delay:0.0 options:UIViewAnimationCurveEaseInOut animations:^
{
sourceViewController.view.frame = CGRectMake(0, parent.frame.size.height, sourceViewController.view.frame.size.width, sourceViewController.view.frame.size.height);
} completion:^(BOOL finished)
{
[sourceViewController presentViewController:destinationViewController animated:NO completion:NULL];
}];
}