I have a standard UIImageView with its ContentMode set to UIContentModeAspectRatioFit.
I am trying to find out how to get the position of the image relative to either the absolute coordinates or the UIImageView origin.
Is this possible? I have seen lots of posts about how it’s not possible to set the position, but nothing on whether or not it’s possible to GET the position.
Many thanks,
Brett
OK, so I figured it out with a bit of a hack.
I used Trevor Harmon’s image
resizedImageWithContentModefunction to resize the image to the size of the UIImageView. Then I kept the image size and did away with the image (I only need the size, not the image itself). Followed with some simple math, and we have the position of the image in the frame!FYI: Trevor Harmon’s code is at: http://vocaro.com/trevor/blog/