Skip to content

Instantly share code, notes, and snippets.

@NickHung1982
Created December 2, 2018 15:36
Show Gist options
  • Save NickHung1982/84a27d45ba4f096edc3d77cbedfde544 to your computer and use it in GitHub Desktop.
Save NickHung1982/84a27d45ba4f096edc3d77cbedfde544 to your computer and use it in GitHub Desktop.
// 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