当我按下按钮时,我想在 UIViewController 中从 UIView 转换到另一个
我写了这段代码:
- (IBAction)changeView:(id)sender {
CATransition* transition = [CATransition animation];
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
transition.duration = 1.0f;
transition.type = @"cube";
transition.subtype = @"fromTop";
[self.view1.layer removeAllAnimations];
[self.view1.layer addAnimation:transition forKey:kCATransition];
}
此代码会将 view1(UIview) 传输到自身。我怎样才能让它过渡到另一个 UIView(例如 view2)。我在哪里可以将另一个 UIview (view2) 放在情节提要中