Search code examples
iphonexcodeuiimageviewrotationinterface-builder

How can I rotate an UIImageView in Interface Builder?


Is it possible to rotate an UIImageView in Interface Builder from XCode? Like I can do it in Photoshop, where I can scale and rotate an image.

I know it is possible by code but is there a way to do this in the interface builder?


Solution

  • You can't do this in the current version of Xcode. You may submit a feature request to Apple at https://feedbackassistant.apple.com/

    However if you want to do it, you will need to write some code

    #define RADIANS(degrees) ((degrees * M_PI) / 180.0)
    
    theView.transform = CGAffineTransformRotate(theView.transform, radians)