Ios CGAffineTransformRotate后如何获取UIImageView的CGRect?

Ios CGAffineTransformRotate后如何获取UIImageView的CGRect?,ios,objective-c,xcode,cgrect,Ios,Objective C,Xcode,Cgrect,在我的游戏中,我将UIImageview旋转30度,我需要得到旋转后的UIImageview的转换CGRect,请有人帮我编写示例代码 UIImageView *mainImgB = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, width, hight)]; [mainImgB setBackgroundColor:[UIColor greenColor]]; mainImgB.layer.anchorPoint = CGPointMak

在我的游戏中,我将UIImageview旋转30度,我需要得到旋转后的UIImageview的转换CGRect,请有人帮我编写示例代码

UIImageView *mainImgB = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, width, hight)];
[mainImgB setBackgroundColor:[UIColor greenColor]];
mainImgB.layer.anchorPoint = CGPointMake(0, 0);
mainImgB.center = CGPointMake(View.frame.size.width/2, View.frame.size.height/2);
mainImgB.transform =  CGAffineTransformRotate(mainImgB.transform,30 * M_PI/180); 

谢谢

使用
CGRectApplyAffineTransform

 CGRect newRect = CGRectApplyAffineTransform(yourViewOnWhichTransformGetsApplied.frame, yourTransformHere);

你的意思是:CGRect newRect=CGRectApplyAffineTransform(mainImgB.frame,mainImgB.transform);,但我仍然没有得到正确的CGRect转换后仍然我的CGRect的方式,请一些人分享工作代码样本。