There are two main ways to draw your line.
One way is to create a subclass of UIView
and override its drawRect:
method. This is described in “The View Drawing Cycle” in the Drawing and Printing Guide for iOS.
The other way is to use a CAShapeLayer
. There are lots of answers on stackoverflow about using a shape layer. Check out this answer for a start.