Created
August 8, 2018 14:40
-
-
Save J7mbo/6f943805edd6d9afd5944ee3e46e8ad2 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
DispatchQueue.global(qos: .background).async { | |
let jsonDownloader: JsonDownloader = JsonDownloader() | |
let imageDownloader: ImageDownloader = ImageDownloader() | |
let json: [String: AnyObject] = jsonDownloader.downloadContentsOfUrl("ourUrl.com") | |
let image: UIImage = imageDownloader.downloadImage(URL(string: json["image_url"])) | |
DispatchQueue.main.async { | |
// -- SNIP -- Add image to UIImageView and add a subview in UIView | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment