IOS Custom interface switch animation-Custom Segue,-customsegue
Original Blog, reprinted, please indicate the source
Http://blog.csdn.net/hello_hwc? Viewmode = contents
The implementation method is to inherit the UIStoryboardSegue class, rewrite the Perform method, and set the class to a custom class on the Storyboard.
This code is used to create an animation with a gradient filled with screens from the center.
-(void)perform{ UIViewController * svc = self.sourceViewController; UIViewController * dvc = self.destinationViewController; [svc.view addSubview:dvc.view]; [dvc.view setFrame:svc.view.frame]; [dvc.view setTransform:CGAffineTransformMakeScale(0.1, 0.1)]; [dvc.view setAlpha:0.0]; [UIView animateWithDuration:1.0 animations:^{ [dvc.view setTransform:CGAffineTransformMakeScale(1.0, 1.0)]; [dvc.view setAlpha:1.0]; } completion:^(BOOL finished) {// [dvc.view removeFromSuperview]; }];}
Final Diagram
Complete Demo project
Http://pan.baidu.com/s/1qWodA7E