Effect
#import "ViewController.h"@interfaceViewcontroller () @property (weak, nonatomic) Iboutlet Uiimageview*Panimageview;/** */@property (nonatomic,assign)intangle;/** Turntable Time*/@property (strong,nonatomic) Nstimer*timer;/** Timer*/@property (strong,nonatomic) Nstimer*Timetick;/** Timekeeping Time*/@property (nonatomic,assign)intTimenumber;@end@implementationViewcontroller- (void) viewdidload {[Super viewdidload]; Self.timenumber=3; Self.timer= [Nstimer scheduledtimerwithtimeinterval:0.01target:self selector: @selector (startanimation) Userinfo:nil Repeats:yes]; Self.timetick= [Nstimer scheduledtimerwithtimeinterval:1.0target:self selector: @selector (Timefiremethod) Userinfo:nil Repeats:yes]; }-(void) startanimation{[UIView Beginanimations:nil Context:nil]; [UIView setanimationduration:1]; [UIView setanimationdelegate:self]; _panimageview.animationrepeatcount=1;//[UIView setanimationdidstopselector: @selector (startanimation)];Self.angle + = +; Self.panImageView.layer.anchorPoint= Cgpointmake (0.5,0.5);//to the lower right corner for the origin, (0,0) is the upper left corner, (0.5,0,5) center turn, and so on .Self.panImageView.transform = Cgaffinetransformmakerotation (Self.angle * (M_PI/180.0f)); [UIView commitanimations]; }-(void) timefiremethod{Self.timenumber-- ; if(Self.timenumber = =0) {[Self.timer invalidate]; }}@end
The effect of the IOS implementation carousel