Skip to content

Instantly share code, notes, and snippets.

@pietrorea
Last active August 29, 2015 14:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save pietrorea/9887ce31f1d09c87114b to your computer and use it in GitHub Desktop.
Weak reference to self within a Swift block
let dataTask = urlSession.dataTaskWithURL(url!, completionHandler: { [unowned self] (data: NSData!, response: NSURLResponse!, error: NSError!) -> Void in
//add code here
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment