title: How to get data from a Swift NSURLSession?
body: <p>For example, I have the following code:</p>
  <pre><code>let task = NSURLSession.sharedSession().dataTaskWithURL(url, completionHandler: {data, response, error -&gt; Void in
          var dann = NSString(data: data, encoding: NSUTF8StringEncoding)!
          self.str = dann
  })
  task.resume()
  </code></pre>
  <p>I want to transfer the data to a variable in the class (the <code>str</code> variable in the class). The string <code>self.str = dann</code> does not convey anything. How can I do this?</p>