如何从swift 3 facebook图形请求中解析这个JSON

sli*_*boy 1 facebook facebook-graph-api ios swift swift3

我使用图形请求使用此代码获取json:

nextrequest.start({ (response: HTTPURLResponse?, result: Any?) in

                print(result)
})
Run Code Online (Sandbox Code Playgroud)

这是result下面的json ,我不知道如何访问内部的数据,如性别,ID和名称......

Optional(FacebookCore.GraphRequestResult<FacebookCore.GraphRequest>.success(FacebookCore.GraphResponse(rawResponse: Optional({
gender = male;
id = 1128614937219535;
name = "Rayan Slim";
picture =     {
    data =         {
        height = 320;
        "is_silhouette" = 0;
        url = "https://scontent.xx.fbcdn.net/v/t1.0-1/p320x320/12541113_961418627272501_5451131278168499090_n.jpg?oh=47433bc236ce63ce1c07b92499087f29&oe=586A406A";
        width = 320;
    };
};
}))))
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激!!!!

web*_*kie 6

在获得许可后,这里的功能是有效的.

    if AccessToken.current != nil {
    GraphRequest(graphPath: "me", parameters: ["fields": "id, name, first_name, last_name, picture.type(large), email"]).start({ (urlResponse, requestResult) in

        switch requestResult {
        case .Success(let response):

            if let responseDictionary = response.dictionaryValue {
                let email = responseDictionary["email"] as? String
                print(email)
                let first = responseDictionary["name"] as? String
                print(first)
                if let picture = responseDictionary["picture"] as? NSDictionary {
                    if let data = picture["data"] as? NSDictionary{
                        if let profilePicture = data["url"] as? String {
                            print(profilePicture)
                        }
                    }
                }
            }
        case .Failed(let error):
            print(error)

        }
    })
}
Run Code Online (Sandbox Code Playgroud)