I am trying to check if the filename of the image loaded in the imageView is equal to a certain string.
For example with parse i did it this way:
if let user = PFUser.currentUser(){
if let imageData = user["profilePic"] as? PFFile { // ? Optional because there can be no image uploaded yet.
if imageData.name.containsString("avatarImageFile"){ //If was not the avatar image then continue
//Mark: If latest profile pic uploaded was the avatar image then do this
profileLable.text = "Upload Profile Picture"
Now I'm trying to do that with an image in the image view but cannot find any property to help me find the file name string. So i tried this but not working either.
let img = imagePreview.image
// let imgData = UIImageJPEGRepresentation(img!, 0.1)
if img!.isEqual(UIImage(contentsOfFile: "gallery-icon after tap.jpg")){
print("not to be parsed")
}else {
print("to be parsed")
}
Anybody knows a way to compare the filename string contents of the image file that is in the image view.