When would an UIView's bounds.origin
not be (0, 0)
?
This paragraph was helpful to me:
IMPORTANT!! Bounds X and Y, the origin, are for moving inside the View. For eample X+5, moving 5pix to the left of the frame's origin meaning draw all content within this View to the left 5pix of frame's origin. It doesn't do anything to itself, it is what being drew on it that get affected.
But it describes only the case when I had set the value of bounds.origin
myself.
In what other cases the value of bounds.origin != (0, 0)
?
(edited again because I can’t delete my original answer after it was accepted—credit for this goes to ian, who posted a more thorough answer below:)
In most cases this won’t happen. If you initialize your view with a negative width and/or height, you’ll get an origin with a negative X of the width and/or negative Y of the height.