title: Storing values in completionHandlers - Swift
body: <p>I am creating a <code>completionHandler</code> which returns a Dictionary but when I call this method in another class the value of it is nil.</p>
  
  <pre><code>func fetchLatestPosts(completionHandler: (responseDict: NSDictionary) -&gt; Void in {
  // Bunch of JSON Parsing for dictionary to be completed
  var theDictionary = JSON Dictionary value
  responseDict = theDictionary as NSDictionary
  }
  </code></pre>
  
  <p>Then I am attempting to call it in another class so that the value that <code>fetchLatestPost</code> Dictionary can be viewed and data presented based on that.
  For Example,</p>
  
  <pre><code>func parseDictionary() {
  NetworkManager.sharedInstance.fetchLatestPosts(responseDict: NSDictionary)
  if (responseDict != nil) {
  println("Dictionary is not empty")
  }
  </code></pre>
  
  <p>The issue here is that when I am calling the <code>fetchLatestPosts</code> function I am receiving a <code>nil</code> value when attempting to call the Dictionary.</p>
  
  <p>In short, my question is how can I assign values to the completion handler are stored and can be called elsewhere within the Xcode project?</p>