Created
August 27, 2011 05:47
-
-
Save cppforlife/1175040 to your computer and use it in GitHub Desktop.
Comparing UIImages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UIImage (ToEqualByBytes) | |
- (BOOL)toEqualByBytes:(UIImage *)otherImage; | |
@end | |
@implementation UIImage (ToEqualByBytes) | |
- (BOOL)toEqualByBytes:(UIImage *)otherImage { | |
NSData *imageData = (NSData *)CGDataProviderCopyData(CGImageGetDataProvider(self.CGImage)); | |
NSData *otherImageData = (NSData *)CGDataProviderCopyData(CGImageGetDataProvider(otherImage.CGImage)); | |
return [imageData isEqualToData:otherImageData]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment