Last active
October 16, 2018 11:03
-
-
Save KiranJasvanee/4989e28389e19d7baa4157e778e29ca3 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
func tryWeak() { | |
// let's get image data from server to load it in our imageview. | |
self.getData(from: URL.init(string: self.imageToBeShown)!) { [weak self] (data, response, error) in | |
DispatchQueue.main.async { | |
self?.imageView.image = UIImage.init(data: data!) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment