-(void)drawText:(CGRect)rect{
NSString *str = @"姜灵凤姜灵凤姜灵凤姜灵凤姜灵凤姜灵凤姜灵凤姜灵凤";
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
dict[NSFontAttributeName] = [UIFont systemFontOfSize:30];
dict[NSForegroundColorAttributeName] = [UIColor greenColor];
dict[NSStrokeColorAttributeName] = [UIColor redColor];
dict[NSStrokeWidthAttributeName] = @2;
NSShadow*shadow = [[NSShadowalloc]init];
shadow.shadowColor = [UIColor blueColor];
shadow.shadowOffset=CGSizeMake(1,1);
shadow.shadowBlurRadius = 2;
dict[NSShadowAttributeName] = shadow;
[strdrawInRect:rect withAttributes:dict];
}
https://www.bilibili.com/video/BV1bJ411T7fj?p=81