CGPathRef border = ... get a path from somewhere; CGContextRef context = UIGraphicsGetCurrentContext (); CGContextSaveGState (context); { CGContextAddPath (context, border); CGContextClip (context); // draw draw draw } CGContextRestoreGState (context);