|
@@ -1243,4 +1243,17 @@
|
|
|
return [emailTest evaluateWithObject:checkString];
|
|
|
}
|
|
|
|
|
|
++ (UIImage*)drawText:(NSString*)text inImage:(UIImage*)image atPoint:(CGPoint)point
|
|
|
+{
|
|
|
+ UIGraphicsBeginImageContext(image.size);
|
|
|
+ [image drawInRect:CGRectMake(0,0,image.size.width,image.size.height)];
|
|
|
+ CGRect rect = CGRectMake(point.x, point.y, image.size.width, image.size.height);
|
|
|
+ [[UIColor whiteColor] set];
|
|
|
+ [text drawInRect:CGRectIntegral(rect) withAttributes:@{NSFontAttributeName: [UIFont boldSystemFontOfSize:12], NSForegroundColorAttributeName:[UIColor whiteColor]}];
|
|
|
+ UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
|
|
|
+ UIGraphicsEndImageContext();
|
|
|
+
|
|
|
+ return newImage;
|
|
|
+}
|
|
|
+
|
|
|
@end
|