1 {2 cgfloat angle;3 }4 5- (void) Viewdidload {6 [Super Viewdidload];7Angle =0;8 [self startanimation];9 }Ten One //Method 1 A-(void) Startanimation - { - [UIView Beginanimations:nil context:nil]; the[UIView setanimationduration:0.01]; - [UIView setanimationdelegate:self]; - [UIView setanimationdidstopselector: @selector (endanimation)]; -Self.scanImage.transform = cgaffinetransformmakerotation (Angle * (M_PI/180.0f)); + [UIView commitanimations]; - } + A-(void) Endanimation at { -Angle + =2; - [self startanimation]; - } - - //Method 2 in- (void) Startanimation - { toCgaffinetransform endangle = cgaffinetransformmakerotation (Angle * (M_PI/180.0f)); + -[UIView animatewithduration:0.01Delay0Options:uiviewanimationoptioncurvelinear animations:^{ theSelf.scanImage.transform =Endangle; *} completion:^(BOOL finished) { $Angle + =2; [Self startanimation];Panax Notoginseng }]; -}
iOS Development animation (Animation) picture 360-degree rotation