The size of the view should be controllable at all times. Today we're going to implement a zoom animation of a view. The implementation of this animation is slightly different from displacement animation, transparency animation.
Detailed implementations such as the following:
Import Uikitclass Scaleviewcontroller:uiviewcontroller { @IBOutlet weak var greensquare:uiview! Override Func Viewdidload () { super.viewdidload () //Do any additional setup after loading the view. } Override Func didreceivememorywarning () { super.didreceivememorywarning () //Dispose of any of the resources that can Be recreated. } Override func Viewdidappear (animated:bool) { super.viewdidappear (animated) func Anim () { Self.greenSquare.transform = Cgaffinetransformmakescale (0.5, 0.5)//shrinks to 0.5 times times the original. } Uiview.animatewithduration (1, Animations:anim) }}
(3) Execution procedure. Discover that the view can become the original X. 0.5 times times on the Y axis.
GitHub home: https://github.com/chenyufeng1991. You are welcome to inquire.
iOS project development-a scaled animation of the production view