DevPrep

All topics › UIKit

What are views and what is UIView?

Junior PRO

The gist

A view is a rectangular region of the screen that can draw itself, lay out child views and respond to events. An interface is assembled from a tree of views: window → the controller's root view → containers → buttons, labels, images. UIView is the base class of every view in UIKit.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store