calayer *layer = [calayer layer];
Layer. delegate = self;
bounds = CGRectMake (0 , 0 , 100 , Span style= "font-variant-ligatures:no-common-ligatures; Color: #272ad8 ">100 );
Layer. position = cgpointmake(+) ;
layer. Anchorpoint = Cgpointzero;
layer. BackgroundColor = [uicolor blackcolor]. Cgcolor;
[Layer setneedsdisplay];
[Self. View. Layer addsublayer: layer];
-(void) Drawlayer: (calayer *) layer Incontext: (cgcontextref) ctx
{
cgcontextsetrgbfillcolor (CTX, 1.0 0 , 0 , 1.0 );
Cgcontextaddrect(CTX,CGRectMake(0, 0, -, -));
Cgcontextfillpath(CTX);
}
Cabasicanimation *basicanimation = [cabasicanimation animation];
Basicanimation.keypath = @ "position";
Basicanimation.fromvalue = [Nsvalue valuewithcgpoint:cgpointmake (0, 0)];
Basicanimation.tovalue = [Nsvalue valuewithcgpoint:cgpointmake (a) ];
Basicanimation.duration = 1.0;
Basicanimation.removedoncompletion = NO; // do not delete animations after the animation has finished executing
Basicanimation.fillmode = Kcafillmodeforwards; // keep up-to-date status
[self. Layer addanimation:basicanimation forkey:nil];
IOS Layer cabasicanimation