Created
December 2, 2018 15:36
-
-
Save NickHung1982/84a27d45ba4f096edc3d77cbedfde544 to your computer and use it in GitHub Desktop.
This file contains 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
// func startLoad() { | |
// let url = URL(string: "https://lemulotdotorg.files.wordpress.com/2016/10/dsc00737.jpg")! | |
// //init data | |
// receivedData = Data() | |
// let task = session.dataTask(with: url) | |
// task.resume() | |
// | |
// } | |
func startLoad(){ | |
let url = URL(string: "https://lemulotdotorg.files.wordpress.com/2016/10/dsc00737.jpg")! | |
let networking = HTTPNetworking() | |
networking.request(from: self, url: url, completion: { data in | |
if let data = data { | |
DispatchQueue.main.async { | |
self.button1.isEnabled = true | |
self.imageview1.image = UIImage(data: data) | |
} | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment