#ViewController. M
#import "ViewController.h" @interface viewcontroller ()/** * Storybord connection */@property (weak, nonatomic) Iboutlet Uiimagevi EW *imageview; @end @implementation viewcontroller-(void) viewdidload {[Super viewdidload];} -(void) Touchesbegan: (Nsset *) touches withevent: (uievent *) event{NSLog (@ "Touchesbegan"); self.view.userInteractionEnabled = NO; Create a rotated animation object cabasicanimation *rotate = [cabasicanimation animation]; Rotate.keypath = @ "Transform.rotation"; Rotate.tovalue = @ (M_PI * 10); Create a scaled animation object cabasicanimation *scale = [cabasicanimation animation]; Scale.keypath = @ "Transform.scale"; Scale.tovalue = @ (0.0); Create a panning animation object cabasicanimation *translation = [cabasicanimation animation]; Translation.keypath = @ "Transform.translation"; Translation.tovalue = [Nsvalue valuewithcgpoint:cgpointmake (300, 500)]; Add all animations to the group caanimationgroup *group = [Caanimationgroup animation]; Group.animations = @[rotate, scale, translation]; Group.duration = 10; Group.delegate = self;//Group.removedoncompletion = no;//Group.fillmode = kcafillmodeforwards; [Self.imageView.layer Addanimation:group forkey:nil];} #pragma mark-animation start-(void) Animationdidstart: (caanimation *) anim{NSLog (@ "Animationdidstart");} #pragma mark-end of Animation-(void) Animationdidstop: (Caanimation *) Anim finished: (BOOL) flag{self.view.userInteractionEnabled = YES; NSLog (@ "Animationdidstop");} -(void) touchesended: (Nsset *) touches withevent: (uievent *) event{NSLog (@ "touchesended");} @end
iOS group animation,