Cabasicanimation Animation
1 //cabasicanimation-Opacity2 @IBAction func cabopacity ()3 {4Let animation = Cabasicanimation (keypath:"Opacity")5 6animation!. Fromvalue =1.07animation!. Tovalue =0.08Animation.duration =3.09Self.testImageView.layer.addAnimation (animation, Forkey:"image-opacity")TenSelf.testimageview.alpha=0.0; One } A - //turn on the Clip Subview property - @IBAction func cabexpend () the { - //from small to lower (if the mode attribute is changed to center, this effect is masked) -Let animation = Cabasicanimation (keypath:"bounds.size") -animation!. Fromvalue = Nsvalue (Cgsize:cgsizemake (2.0,2.0)) +animation!. Tovalue =Nsvalue (CGSize:self.testImageView.frame.size) -Animation.duration =3.0 +Self.testImageView.layer.addAnimation (animation, Forkey:"Image-expen") A } at
iOS development--animated programming Swift & (iv) Cabasicanimation animation