このコードはこちらで見つかりましたが、使い方がわかりません。
- (void)drawRect:(CGRect)rect
{
CGRect bounds = [self bounds];
[[UIColor blackColor] set];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextClipToMask(context, bounds, [myImage CGImage]);
CGContextFillRect(context, bounds);
}
UIImage をサブクラス化していますか? drawRect をどこで呼び出す必要がありますか? ありがとう