Crie uma borda tracejada usando CoreGraphics no iOS

Em sua subclasse de visualização customizada coloca esse código no método drawRect.

- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();

CGContextSetStrokeColorWithColor(context, [[UIColor grayColor] CGColor]);

CGFloat dashes[] = {1,1};

CGContextSetLineDash(context, 0.0, dashes, 2);
CGContextSetLineWidth(context, 1.0);

CGContextMoveToPoint(context, CGRectGetMinX(rect), CGRectGetMaxY(rect));
CGContextAddLineToPoint(context, CGRectGetMaxX(rect), CGRectGetMaxY(rect));
CGContextAddLineToPoint(context, CGRectGetMaxX(rect), CGRectGetMinY(rect));
CGContextAddLineToPoint(context, CGRectGetMinX(rect), CGRectGetMinY(rect));
CGContextAddLineToPoint(context, CGRectGetMinX(rect), CGRectGetMaxY(rect));
CGContextSetShouldAntialias(context, NO);
CGContextStrokePath(context);
}