¿Cómo hago que UILabel muestre el texto resumido?

Todo lo que quiero es un borde negro de un píxel alrededor de mi texto UILabel blanco.

Llegué a subclasificar a UILabel con el código de abajo, que torpemente formé de algunos ejemplos en línea relacionados tangencialmente. Y funciona, pero es muy, muy lento (excepto en el simulador) y tampoco pude centrar el texto verticalmente (así que codifiqué el valor de y en la última línea temporalmente). Ahhhh

void ShowStringCentered(CGContextRef gc, float x, float y, const char *str) {
    CGContextSetTextDrawingMode(gc, kCGTextInvisible);
    CGContextShowTextAtPoint(gc, 0, 0, str, strlen(str));
    CGPoint pt = CGContextGetTextPosition(gc);

    CGContextSetTextDrawingMode(gc, kCGTextFillStroke);

    CGContextShowTextAtPoint(gc, x - pt.x / 2, y, str, strlen(str));
}


- (void)drawRect:(CGRect)rect{

    CGContextRef theContext = UIGraphicsGetCurrentContext();
    CGRect viewBounds = self.bounds;

    CGContextTranslateCTM(theContext, 0, viewBounds.size.height);
    CGContextScaleCTM(theContext, 1, -1);

    CGContextSelectFont (theContext, "Helvetica", viewBounds.size.height,  kCGEncodingMacRoman);

    CGContextSetRGBFillColor (theContext, 1, 1, 1, 1);
    CGContextSetRGBStrokeColor (theContext, 0, 0, 0, 1);
    CGContextSetLineWidth(theContext, 1.0);

    ShowStringCentered(theContext, rect.size.width / 2.0, 12, [[self text] cStringUsingEncoding:NSASCIIStringEncoding]);
}

Tengo la sensación de que estoy pasando por alto una forma más sencilla de hacer esto. Tal vez al anular "drawTextInRect", pero parece que no puedo obtener drawTextInRect para doblar mi voluntad a pesar de mirarlo fijamente y fruncir el ceño realmente muy fuerte.

Respuestas a la pregunta(12)

Su respuesta a la pregunta