Search code examples
iosiphonexcodeswiftcgaffinetransform

rotating image scale down my image


I am working on compass app in ios.I am using the following code to rotate compass

        self.compassImage.transform = CGAffineTransformMakeRotation(CGFloat(headingAngle))

Its rotating according to my rotation degree.But the image getting scaled to small or big.Please give some idea to solve this.


Solution

  • I have kept my button on UIView.After that I have rotated my view using the same code.It works fine.