Junior — Middle
Under what conditions can the sizes of the frame and the object's border not match?
sobes.tech AI
Answer from AI
The sizes of the frame and bounds of an object in iOS may not match if the object undergoes transformations, such as scaling, rotation, or translation.
- frame is a rectangle describing the position and size of the object in the superview's coordinate system.
- bounds is a rectangle describing the internal coordinates of the object, usually starting at (0,0) and reflecting its own size.
If the view is rotated or scaled, the frame will change to contain the transformed object, while the bounds will remain the same. For example, when rotated by 45°, the frame will be larger than the bounds to accommodate the new outline of the object.