UnsplashKit icon indicating copy to clipboard operation
UnsplashKit copied to clipboard

"We couldn't find that photo"

Open afkatja opened this issue 9 years ago • 1 comments

This is more a question than an issue.

What

At random times, my query returns this placeholder image for no results, while no error is thrown. simulator screen shot 15 nov 2016 15 53 53

Context

I use the UnsplashClient().randomPhoto(fromSearch: [searchTerm]) call with searchTerm being a name of a city entered by a user. The result of this call seems to always be .success.

afkatja avatar Nov 15 '16 14:11 afkatja

Hi @afkatja! and thank you for using the library 😃

Regarding your question, Unsplash API always returns an image like this one when it couldn't find a proper image. In this case, if you use the search and the API can not find any photo related to the search terms, then, it returns this photo.

The problem is that is hard to decide if this image is the real photo or the not-found photo. That's why you receive this image through the .success.

sergigracia avatar Nov 17 '16 10:11 sergigracia