IOS Custom Transition Animations

Source: Internet
Author: User

1,firstvcview for your current view 2,secondvcview as you need to jump to the view 3,viewcon with the second item do not pass in the view directly into the object.

* Here is the call uiviewobject for you to jump the class ID is the value you need to pass

Let view = Uiviewobject ()
View.id = Self.id

Self.performanimationback (Self.view, SecondVCView:lineList.view, Viewcon:linelist)

    Custom Cut animation func performanimationback (Firstvcview:uiview, Secondvcview:uiview, Viewcon:uiviewcontroller) {                Assign the source and destination views to the local variables.        Get the screen width and height. Let ScreenWidth = Uiscreen.mainscreen (). bounds.size.width Let screenheight = Uiscreen.mainscreen (). Bounds.size.heig        HT//Specify the initial position of the destination view. Secondvcview.frame = CGRectMake (-screenwidth, 0.0, screenwidth, screenheight)//Access The app ' s key windo        W and insert the destination view above the current (source) one. let window = Uiapplication.sharedapplication (). keywindow window?.        Insertsubview (Secondvcview, Abovesubview:firstvcview)//Animate the transition. Uiview.animatewithduration (0.4, animations: {(), Void in firstvcview.frame = Cgrectoffset (Firstvcview.fra Me, ScreenWidth, 0.0) Secondvcview.frame = CgrecToffset (Secondvcview.frame, ScreenWidth, 0.0)}) {(finished)-Void in//Self.dismissviewco Ntrolleranimated (True, Completion:nil) Self.presentviewcontroller (Viewcon, ANIMATED:FA LSE, COMPLETION:NIL)}}

IOS Custom Transition Animations

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.