react-native-navigation的迁移库

1234567891011121314151617181920
  1. #import "UIImage+Utils.h"
  2. @implementation UIImage (Utils)
  3. + (UIImage*)emptyImage {
  4. UIGraphicsBeginImageContext(CGSizeMake(10, 10));
  5. UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
  6. UIGraphicsEndImageContext();
  7. return image;
  8. }
  9. - (BOOL)isEqual:(UIImage *)image {
  10. NSData *data1 = UIImagePNGRepresentation(self);
  11. NSData *data2 = UIImagePNGRepresentation(image);
  12. return [super isEqual:image] || [data1 isEqual:data2];
  13. }
  14. @end