I need to check if a file loaded into an UIImage object file is equal to another image and execute some actions if so. Unfortunately, it\'s not working.
UIImage
You can go even further an implement the equality operator on UIImage, which will ease your logic when it comes to comparing images:
func ==(lhs: UIImage, rhs: UIImage) -> Bool { lhs.pngData() == rhs.pngData() }
This also enables the != operator on UIImage.
!=