As the documentation says,
drawRect: Draws the receiverβs image within the passed-in rectangle.
Parameters
rect: a rectangle defining the area to limit drawing.
This method is used to draw your UIView inside a specific view rectangle.
drawRect: . , . , setNeedsDisplay . UIView, , .
, , , UIView . , : , ; - .
.
subviews, layoutIfNeeded . .
. , , ,