I have an imageview that has a pinchgesturerecognizer attached to it. In the pinchgesturerecognizer delegate method, I need to calculate the frame value of the transformation before it occurs in order to see if the scaling has pushed the imageview out of the bounds of the window. I know I need to use CGRectApplyAffineTransform to calculate the frame value each time, but since the imageview frame value will be invalid after the first transformation gets performed, do I need to now store the update frame value in an instance variable and keep updating it everytime a transform occurs, or is there someway I can obtain this value from the imageview itself?
I have an imageview that has a pinchgesturerecognizer attached to it. In the pinchgesturerecognizer
Share
So you want to check if a
UIImageViewis inside its window?I think you can ignore the view frame and instead start your calculations
from the view bounds. This will include the transformation you have applied to the view.
Apple has a section named The Relationship of the Frame, Bounds, and Center Properties in the View Programming Guide for iOS.