title: Use of unresolved identifier 'json'
body: <p>I am receiving the error: <code>Use of unresolved identifier 'json'</code></p>
  
  <p>from this line:  <code>if let parseJSON = json {</code></p>
  
  <p>This is the snippet of the code relevant to the error</p>
  
  <pre><code>        let task = NSURLSession.sharedSession().dataTaskWithRequest(request){
            data, response, error in
  
              if error != nil {
                  print("error=\(error)")
                  return
              }
              do {
                  if let jsonResult = try NSJSONSerialization.JSONObjectWithData(data!, options: []) as? NSDictionary {
                      print(jsonResult)
                  }
              } catch let error as NSError {
                  print(error.localizedDescription)
              }
              if let parseJSON = json {
                  var resultValue:String = parseJSON["status"] as String!;
                  print("Result: \(resultValue)")
  
                  if(resultValue=="Success")
                  {
  
              //Login is sucessful
              NSUserDefaults.standardUserDefaults().setBool(true,forKey:"isUserLoggedIn");
               NSUserDefaults.standardUserDefaults().synchronize()
  
                      self.dismissViewControllerAnimated(true, completion: nil)
  
  }
  
  }
  
  }
  
  task.resume()
  
  }
  
  }
  </code></pre>
  
  <p>I reviewed this problem: <a href="https://stackoverflow.com/questions/33253340/swift-use-of-unresolved-identifier-json">Swift : Use of unresolved identifier &#39;json&#39;</a> but I do not know how I can fix my issue or where to put the variable of <code>json</code></p>