// Draws a disclosure indicator such that the tip of the arrow is at (x,y)
void BRDrawDisclosureIndicator(CGContextRef ctxt, CGFloat x, CGFloat y) {
static const CGFloat R = 4.5; // "radius" of the arrow head
static const CGFloat W = 3; // line width
CGContextSaveGState(ctxt);
CGContextMoveToPoint(ctxt, x-R, y-R);
CGContextAddLineToPoint(ctxt, x, y);
CGContextAddLineToPoint(ctxt, x-R, y+R);
CGContextSetLineCap(ctxt, kCGLineCapSquare);
CGContextSetLineJoin(ctxt, kCGLineJoinMiter);
CGContextSetLineWidth(ctxt, W);
CGContextStrokePath(ctxt);
CGContextRestoreGState(ctxt);
}
via benzado.com
Useful - especially if you're just getting started manually drawing things. Here's the context and stroke color setting code I used just before calling this function (which I translated to an instance method in a category on UIView):
CGContextRef context = UIGraphicsGetCurrentContext(); if(!highlighted) CGContextSetStrokeColorWithColor(context, [[UIColor grayColor] CGColor]); else CGContextSetStrokeColorWithColor(context, [[UIColor whiteColor] CGColor]);