Daily iOS
UIKit

UIView and CALayer

How do UIView and CALayer relate to each other, and why are their roles split?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

UIView is a thin wrapper that handles events, layout, and responder duties, while the backing CALayer does the actual drawing, compositing, and animation. The view owns its layer rather than subclassing it.

Share a question