0

Is it possible to compare to PFFiles? I am trying to check whether a downloaded PFFile:

let imageFile = object["groupImage"] as PFFile

is equal to a mock data created by me like this:

 let imageData = UIImagePNGRepresentation(UIImage(named: "dot.png")!)
    uploadMock = PFFile(name: "mock", data: imageData!)

Now it happens when I call the comparison, it will not work.

if (mock?.isEqual(image))!{

            print(true)
        } else{

            print(false)

        }

will always give false, even though the images are the same. It seems like it would be necessary, to download the image before. I tried to work around with checking the filename (it worked used to work until I transferred to another database).

Any ideas?

JVS
  • 2,592
  • 3
  • 19
  • 31
  • you mean you want to actually want to compare two images that each `PFFile` object points to? – Adeel Miraj Mar 21 '17 at 12:53
  • exactly. the question is, is there a way without downloading it, since it would cost an api call – JVS Mar 21 '17 at 16:03
  • Not possible. Consider the analogy on a local machine: it would be like comparing one file's name to another file's contents. – danh Mar 22 '17 at 23:55

0 Answers0