iOS7 では、CGContextSelectFont と CGContextShowText は廃止されました。非推奨メッセージには、Core Text を使用する必要があることが示されていますが、このコードと正確に同等のものはどれかわかりません。
- (void)drawTextInContext:(CGContextRef)context
{
CGContextSelectFont(context, [self.font.fontName cStringUsingEncoding:[NSString defaultCStringEncoding]], self.font.pointSize, kCGEncodingMacRoman);
CGRect textRect = [self textRectForBounds:self.bounds limitedToNumberOfLines:1];
CGContextSetTextPosition(context, textRect.origin.x, textRect.origin.y + 5.0f);
CGContextShowText(context, [self.text cStringUsingEncoding:[NSString defaultCStringEncoding]], strlen([self.text cStringUsingEncoding:[NSString defaultCStringEncoding]]));
}