I'm trying to rotate an image repeatedly (360) with an interval. I found this answer(Image rotation in iOS), appears to be ok, but it's not working for me. When I load the VC I can see slight movement, but that's it. Any ideas? The code I'm using:
- (void)viewDidAppear:(BOOL)animated {
[self.compass setTransform:CGAffineTransformMakeRotation(10*(M_PI/360))];
[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(rotation) userInfo:nil repeats:YES];
}
-(void)rotation{
[self.compass setTransform:CGAffineTransformMakeRotation(10*(M_PI/360))];
}
EDIT:
- (void)viewDidAppear:(BOOL)animated {
[self.compass setTransform:CGAffineTransformMakeRotation(10*(M_PI/360))];
[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(rotation) userInfo:nil repeats:YES];
}
-(void)rotation{
[self.compass setTransform:CGAffineTransformMakeRotation(10*(M_PI/360))];
CGAffineTransform transform = CGAffineTransformRotate(self.compass.transform, 10*(M_PI/360));
[self.compass setTransform:transform];
}