*******
#import "HMViewController.h"@interfaceHmviewcontroller () @property (nonatomic, weak) Calayer*layer;@end@implementationHmviewcontroller- (void) viewdidload{[Super Viewdidload]; //additional setup after loading the view, typically from a nib.Calayer*layer =[Calayer layer]; Layer.position= Cgpointmake ( -, -); Layer.bounds= CGRectMake (0,0, -, -); Layer.backgroundcolor=[Uicolor Redcolor]. Cgcolor; Layer.contents= (ID) [UIImage imagenamed:@"Heart"]. Cgimage; [Self.view.layer Addsublayer:layer]; _layer=layer; }//animated animation of rotation- (void) Touchesbegan: (Nsset *) touches withevent: (Uievent *)Event{ //Create an animated objectCabasicanimation *anim =[cabasicanimation animation]; //set the properties of an animationAnim.keypath =@"Transform.scale"; //set the value of the property changeAnim.tovalue = @0.5; //Set Animation durationAnim.duration =0.25; //Cancel Bounce//do not remove animations after the animation has finished executingAnim.removedoncompletion =NO; //keep up-to-date positionAnim.fillmode =kcafillmodeforwards; //number of repetitions of the animationAnim.repeatcount =maxfloat; //Animate a layer[_layer Addanimation:anim forkey:nil];}//Moving Animations- (void) position{//Create an animated objectCabasicanimation *anim =[cabasicanimation animation]; //set the properties of an animationAnim.keypath =@"position"; //set the value of the property changeAnim.tovalue = [Nsvalue valuewithcgpoint:cgpointmake ( $, $)]; //Set Animation durationAnim.duration =2; //Cancel Bounce//do not remove animations after the animation has finished executingAnim.removedoncompletion =NO; //keep up-to-date positionAnim.fillmode =kcafillmodeforwards; //Animate a layer[_layer Addanimation:anim forkey:nil];}@end
iOS 18th day (5,cabasicanimation basic animation)