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

Error create UIImage #2

Open
gbmiranda opened this issue Jan 27, 2016 · 1 comment
Open

Error create UIImage #2

gbmiranda opened this issue Jan 27, 2016 · 1 comment

Comments

@gbmiranda
Copy link

When the object "data" does not correspond to an image and you force the parse how they are doing in the application error occurs .. not found a way to get around, what do you suggest?

Line: let imageObtained : UIImage = UIImage(data: data)!

@gbmiranda
Copy link
Author

Solution

var imageObtained = UIImage(data: data)

    if imageObtained == nil{
        imageObtained = self.placeholderImage
    }

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

1 participant