UIView memo

Creating UIView Programmatically

-(void)initWithFrame

From nib file

-(void)initWithCoder
-(void)awakeFromNib

Custom drawing

-(void)drawRect

Custom layout

-(void)layoutSubviews

Handle touch-based events

-(void)touchesBegan:withEvent:
-(void)touchesMoved:withEvent:
-(void)touchesEnded:withEvent:
-(void)touchesCancelled:withEvent:

Ref1
Ref2
Ref3