title: Ambiguous reference to member `jsonObject(with:options:)` when trying to get data from json
body: <p>I'm new to Swift and while making one of the tutorials (fairly old) which involves getting credentials from a server through php which returns a JSON, but I'm stuck with the error <code>Ambiguous reference to member jsonObject(with:options:)</code> in the json var, I've searched and trying applying the different solutions but to no avail. :( </p>
  
  <p>Thank you for your time and help.</p>
  
  <p>here is my code:</p>
  
  <pre><code>let userEmail = userEmailTextField.text;
  let userPassword = userPasswordTextField.text;
  
  if((userEmail?.isEmpty)! || (userPassword?.isEmpty)!) {
      displayMyAlertMessage(userMessage: "All Fields are required.")
      return;
  }
  
  let myUrl = URL(string: "/UserLogin.php");
  var request = URLRequest(url:myUrl!);
  request.httpMethod = "POST";
  let postString = "email\(userEmail)&amp;password=\(userPassword)";
  
  request.httpBody = postString.data(using: String.Encoding.utf8);
  
  let task = URLSession.shared.dataTask(with: request as URLRequest) {
  data, URLResponse, error in
  
      if error != nil {
          //print = ("error=\(error)");
          return
      }
  
      var err: Error?
      var json = JSONSerialization.jsonObject(with: data, options: .mutableContainers, error: &amp;err) as? NSDictionary
  
      if let parseJSON = json {
          var resultValue:String = parseJSON["status"] as String!;
          print("result: \(resultValue)")
  
  
          if(resultValue == "Success") {
              //Login Succesful
              UserDefaults.standard.set(true, forKey:"isUserLoggedIn");
              UserDefaults.standard.synchronize();
              self.dismiss(animated: true, completion: nil);
  
          }
      }
  }
  
  task.resume()
  </code></pre>