// Load the same image twice.
UIImage* image1 = [UIImage imageNamed:@"MyImage"];
UIImage* image2 = [UIImage imageNamed:@"MyImage"];
// The image objects may be different, but the contents are still equal
if ([image1 isEqual:image2]) {
// Correct. This technique compares the image data correctly.
}
if (image1 == image2) {
// Incorrect! Direct object comparisons may not work.
}
来自:https://developer.apple.com/documentation/uikit/uiimage?language=objc