Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"We couldn't find that photo" #11

Open
afkatja opened this issue Nov 15, 2016 · 1 comment
Open

"We couldn't find that photo" #11

afkatja opened this issue Nov 15, 2016 · 1 comment
Assignees

Comments

@afkatja
Copy link

afkatja commented Nov 15, 2016

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.

@sergigracia
Copy link
Member

sergigracia commented Nov 17, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants