I want to rotate image with some angle as show in the below image.
I am trying to with that
CGAffineTransform t = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(degrees));
imageView.transform = t;
I am not getting output like this. even I am not close with this.
Here is the code I used to rotate an image by 30 degrees
UIImageView *imgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 20, 320, 400)];
imgView.image = [UIImage imageNamed:@"maxresdefault.jpg"];
[self.view addSubview:imgView];
float degrees = 30.0f;
float radians = (degrees* M_PI/180);
imgView.layer.transform = CATransform3DMakeRotation(radians, 0, 0, 1.0);
The Simulator ScreenShot before transform
Here is the Simulator ScreenShot after Transform
Hope this helps you out.