UIView Basic Animations
1 //MARK:-UIView animation-------------------------------------2 3 //MARK:-uiview Animation-Fade in4 @IBAction func Simpleanimationfadein ()5 {6 uiview.beginanimations (Nil, Context:nil)7Uiview.setanimationduration (2.0)//Set Animation time8Testimageview.alpha =0.09 uiview.commitanimations ()Ten One A // //UIView fade -in puppy with closures - //uiview.animatewithduration (0.3, animations: {(), Void in - //Self.testImageView.alpha = 0.0 the // }) - } - - //MARK:-uiview Animation-Fade out + @IBAction func simpleanimationfadeout () - { + uiview.beginanimations (Nil, Context:nil) AUiview.setanimationduration (2.0)//Set Animation time atTestimageview.alpha =1.0 - uiview.commitanimations () - } - - //MARK:-UIView Animation-Mobile - @IBAction func simpleanimationmovecenter () in { - uiview.beginanimations (Nil, Context:nil) toUiview.setanimationduration (2.0)//Set Animation time +Testimageview.center = Cgpointmake ( -, -) -Uiview.setanimationcurve (Uiviewanimationcurve.easeout)//Set the animation relative speed the uiview.commitanimations () * } $ Panax Notoginseng //MARK:-uiview Animation-resizing - @IBAction func simpleanimationframe () the { + uiview.beginanimations (Nil, Context:nil) AUiview.setanimationduration (2.0)//Set Animation time theTestimageview.frame = CGRectMake ( -,165, -, -) + uiview.commitanimations () -}
iOS development--animation Programming Swift & (i) UIView basic animation