I would like to draw a straight line between where a user touches the screen, and where the touch ends. i need multiple lines, for if the user repeats the touch-drag-release act
I know this is an old question, but based on the answer I wrote the following in Swift:
override func drawRect(rect: CGRect) {
super.drawRect(rect)
UIColor.blackColor().setStroke() // update with correct color
let path = UIBezierPath()
path.lineWidth = UIScreen.mainScreen().scale > 1 ? 0.5 : 1
// change the points to what you need them to be
let leftPoint = CGPointMake(0, CGRectGetHeight(rect))
let rightPoint = CGPointMake(CGRectGetWidth(rect), CGRectGetHeight(rect))
path.moveToPoint(leftPoint)
path.addLineToPoint(rightPoint)
path.stroke()
}