title: Swift version of Facebook iOS SDK and how to access data in Response
body: <p>I have taken over a Swift project and need to add Facebook login functionality. I am getting it to mostly work but am having a problem with this sample code here (<a href="https://developers.facebook.com/docs/swift/graph" rel="nofollow noreferrer">https://developers.facebook.com/docs/swift/graph</a>): </p>
  
  <p>import FacebookCore</p>
  
  <pre><code>struct MyProfileRequest: GraphRequestProtocol {
    struct Response: GraphResponseProtocol {
      init(rawResponse: Any?) {
        // Decode JSON from rawResponse into other properties here.
      }
    }
  
    var graphPath = "/me"
    var parameters: [String : Any]? = ["fields": "id, name"]
    var accessToken = AccessToken.current
    var httpMethod: GraphRequestHTTPMethod = .GET
    var apiVersion: GraphAPIVersion = .defaultVersion
  }
  
  
  let connection = GraphRequestConnection()
  connection.add(MyProfileRequest()) { response, result in
    switch result {
    case .success(let response):
      print("Custom Graph Request Succeeded: \(response)")
      print("My facebook id is \(response.dictionaryValue?["id"])")
      print("My name is \(response.dictionaryValue?["name"])")
    case .failed(let error):
      print("Custom Graph Request Failed: \(error)")
    }
  }
  connection.start()
  </code></pre>
  
  <p>I'm getting an error on compiling the for the line with the dictionaryValue optional saying <code>/Users/jt/a-dev/tabfb/tabfb/LoginViewController.swift:72:31: Value of type 'MyProfileRequest.Response' has no member 'dictionaryValue'</code> . How would I access the user name or id using this? </p>