I have a wheel image in .png format, I want to know how to animate it to rotate continuously, I searched on stackoverflow and found some code fragments that helped me rotate the image, but it wonβt rotate continuously, it just rotated in for a few seconds and stopped, the following code
code in viewdidload
UIImageView *imageToMove = [[UIImageView alloc] initWithImage:[UIImageimageNamed:@"horo_circle.png"]]; [self.view addSubview:imageToMove]; [self rotateImage:imageToMove duration:5.0 curve:UIViewAnimationCurveEaseIn degrees:180];
and animation
- (void)rotateImage:(UIImageView *)image duration:(NSTimeInterval)duration curve:(int)curve degrees:(CGFloat)degrees {
and the following lines after import
#define M_PI 3.14159265358979323846264338327950288 #define DEGREES_TO_RADIANS(angle) (angle / 180.0 * M_PI)
source share