user3255746 user3255746 - 1 year ago 152
iOS Question

Facebook SDK in Swift

I am trying to integrate Facebook login and more into my app but am having a lot of difficulty because there is not much documentation in Swift. I am trying to use this code:

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
parameters:@{ @"fields": @"id,name,friends,birthday,gender,first_name,last_name,friendlists,picture",}
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
// Insert your code here

Any idea what this would be in Swift?

Answer Source
 FBSDKGraphRequest(graphPath: "me",
   parameters: ["fields": "id, name, first_name, last_name, picture.type(large), email, gender"])
    .startWithCompletionHandler({ (connection, result, error) -> Void in

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download