transitionFromView:toView:duration:options:completion:
与[self.view addSubview:secondView];
RootViewController.m
self.svc = [[secondVC alloc]init];
[UIView transitionFromView:self.view toView:self.svc.view duration:1.0 options:UIViewAnimationOptionTransitionFlipFromLeft completion:^(BOOL finished) {}];
类似于
RootViewController.m
self.svc = [[secondVC alloc]init];
[self.view addSubView:self.svc];
[UIView animateWithDuration:0.25
delay:0
options:UIViewAnimationOptionCurveEaseOut.............
第一种方法会导致内存泄漏吗?这种方法是否正确?
答案 0 :(得分:2)
如果您从一个视图切换到另一个视图并想要丢弃第一个视图,则应使用transitionFromView:toView:duration:options:completion:
。如果您向视图添加其他视图,则应使用addSubview: