i want to rotate my imageView in my iOS app 360 degree from its center
(when my label text is "hello")
please help me
if ([myLabel.text isEqualToString:@"hello"] == YES)
{
//here i want the imageView to rotate
}
i want to rotate my imageView in my iOS app 360 degree from its center
(when my label text is "hello")
please help me
if ([myLabel.text isEqualToString:@"hello"] == YES)
{
//here i want the imageView to rotate
}
It seems you want it animated. Otherwise, there is no change in image view.
#define DEGREES_IN_RADIANS(x) (M_PI * x / 180.0);
[UIView animateWithDuration:duration animations:^{
imageView.transform = CGAffineTransformMakeRotation(DEGREES_IN_RADIANS(360));
} completion:nil];
myLabel.transform = CGAffineTransformMakeRotation(degrees * M_PI / 180.0);
If you want ti have it animated, wrap it in an animation block:
[UIView animateWithDuration:duration animations:^{
} completion:nil];