UIBezierPath set context <p>I'm trying to draw some lines using <code>UIBezierPath</code> in an overlay renderer. I get error <code>CGContextSetStrokeColorWithColor: invalid context 0x0</code> which I suspect is due to the <code>UIBezierPath</code> not knowing the context. How do I set the UIBezierPath's context?</p> <p>My <code>MKOverlayRenderer</code> is roughly:</p> <pre><code>override func drawMapRect(mapRect: MKMapRect, zoomScale: MKZoomScale, inContext context: CGContext) { let path = UIBezierPath() path.moveToPoint(...) path.addLineToPoint(...) path.lineWidth = 2 UIColor.blueColor().setStroke() path.stroke() } </code></pre>