比较两个UIImage是否相等
2020-09-10 本文已影响0人
倪大头
转成NSData
- (BOOL)image:(UIImage *)image1 isEqualTo:(UIImage *)image2 {
NSData *data1 = UIImagePNGRepresentation(image1);
NSData *data2 = UIImagePNGRepresentation(image2);
return [data1 isEqual:data2];
}