How to programmatically rotate image by 90 Degrees in iPhone? [duplicate]

//create rect
UIImageView *myImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"my_image.png"]];

//set point of rotation
myImageView.center = CGPointMake(100.0, 100.0);

//rotate rect
myImageView.transform = CGAffineTransformMakeRotation(M_PI_2); //rotation in radians

Leave a Comment