UIView Animação infinita de rotação de 360 graus?
Estou tentando girar umUIImageView
360 graus e consultamos vários tutoriais online. Não consegui fazer nenhum deles funcionar sem oUIView
parando ou pulando para uma nova posiçã
A última coisa que tentei é:
[UIView animateWithDuration:1.0
delay:0.0
options:0
animations:^{
imageToMove.transform = CGAffineTransformMakeRotation(M_PI);
}
completion:^(BOOL finished){
NSLog(@"Done!");
}];
Mas se eu usar 2 * pi, ele não se move (porque é a mesma posição). Se eu tentar fazer apenas pi (180 graus), ele funcionará, mas se eu chamar o método novamente, ele girará para trá
EDITA:
[UIView animateWithDuration:1.0
delay:0.0
options:0
animations:^{
[UIView setAnimationRepeatCount:HUGE_VALF];
[UIView setAnimationBeginsFromCurrentState:YES];
imageToMove.transform = CGAffineTransformMakeRotation(M_PI);
}
completion:^(BOOL finished){
NSLog(@"Done!");
}];
também não funciona. Vai para180
graus, pausa por uma fração de segundo e depois redefine para0
raus antes de começar de nov