Usually UIImageViewit cannot save the image file name, but it only saves UIImage, therefore, it is not possible to get the name of the image file that you add to UIImageView.
This is the way to go, if you want to compare only the image file name, then it cannot be compared.
UIImage,
UIImage *secondImage = [UIImage imageNamed:@"image.png"];
NSData *imgData1 = UIImagePNGRepresentation(self.imageView.image);
NSData *imgData2 = UIImagePNGRepresentation(secondImage);
BOOL isCompare = [imgData1 isEqual:imgData2];
if(isCompare)
{
NSLog(@"Image View contains image.png");
}
else
{
NSLog(@"Image View doesn't contains image.png");
}