Difference between frame, bounds, and center
Source: interviewintermediate
WHAT IT TESTS: Coordinate systems and transform effects. OUTLINE: frame and center are in the superview's space; bounds is the view's own space, usually origin zero. A non-identity transform makes frame undefined to read.
WHAT IT TESTS: Whether you understand which coordinate space each property lives in and the transform caveat. ANSWER OUTLINE: frame describes the view's location and size in its superview's coordinate system; center is the frame's midpoint in that same space; bounds is the view's own internal coordinate system, with origin typically zero and the size matching the frame when there is no transform.
Read the original → interview
- #ios
- #uikit
- #uiview
- #layout
- #transform
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.