Last active
March 21, 2018 10:38
-
-
Save olbrichj/ba6d8e5b8f966db3295f5e2cc4057c58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URLSession.shared.dataTask(with: backendurl!) { data, _, error in | |
if error != nil { | |
print(error) | |
return | |
} | |
let imageurl = String(data: data!, encoding: String.Encoding.utf8) as String! // For simplicity response is only the URL | |
URLSession.shared.dataTask(with: URL(string:imageurl!)!) { (data, response, error) in | |
if error != nil { | |
print(error) | |
return | |
} | |
DispatchQueue.main.async { | |
imageView.image = UIImage(data: data!) | |
} | |
}.resume() | |
}.resume() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment