title: Swift access data outside closure
body: <p>I am newbie to iOS. I have query that how can we access data or variables inside closure. Following is my code snippet.</p>
  
  <pre><code>self.fetchData() { data in
         dispatch_async(dispatch_get_main_queue()) {
              println("Finished request")
              if let data = data { // unwrap your data (!= nil)
              let myResponseStr = NSString(data: data, encoding: NSUTF8StringEncoding) as! String
  
              }
          }
      }      
  </code></pre>
  
  <p>I want to get myResponseStr outside, like 
   self.myString=myResponseStr</p>