IOS Custom interface switching animation-Custom Segue

Source: Internet
Author: User

IOS Custom interface switching animation-Custom Segue

 

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

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.