Is there a simple way to get the visible / drawn rect of a UIImageView's image? The rect needs to be correct for any chosen contentMode and should take masksToBounds into account.
Example1: 100x100 UIImageView with a 200x200 image, masksToBounds = YES and contentMode = BottomLeft should return x=0, y=0 (or 100 depending on the coordinate system), width=100, height=100.
Example2: 100x100 UIImageView with a 200x200 image, masksToBounds = YES and contentMode = Center should return x=50, y=50, width=100, height=100.
Or do I have to calculate it myself depending on the contentMode and masksToBounds settings of the UIImageView? I thought properties on the CALayer of the UIImageView could help me with that, but so far I wasn't able to get the right values.