How to get Facebook User id, email, picture.type (large) in Swift 3
<p>I try to get user <code>id, email, picture.type(large),updated_time</code> from <code>Facebook SDK</code>, I successfully get all of them but I didn't get <strong>picture</strong> gives me:</p>
<blockquote>
<p>Error Cannot call value of non-function type 'Any?!'</p>
</blockquote>
<p>My clear codes under below.</p>
<pre><code>    import UIKit
    import Foundation
    
    class LoginViewController : UIViewController, FBSDKLoginButtonDelegate {
       private var fromLogin = [Login]()
       @IBOutlet weak var loginButton : FBSDKLoginButton!
        
        override func viewDidLoad() {
            super.viewDidLoad()
             // Check Session
            if let token = FBSDKAccessToken.current(){
                print(token.tokenString! as Any)
                self.fetchProfile()
            }

            loginButton.delegate = self
            loginButton.readPermissions = [&quot;email&quot;, &quot;public_profile&quot;]
    }

    // Get Profile
    func fetchProfile() {
        print(&quot;fetch profile&quot;)
        
        // Create facebook graph with fields
         FBSDKGraphRequest(graphPath: &quot;me&quot;, parameters: [&quot;fields&quot;:&quot;id, name, email, picture.type(large), updated_time&quot;]).start { (connection, result, error) in
            
            // check error
            if error != nil {
                // error happen
                print(&quot;Failed to start graph request: \(error?.localizedDescription)&quot;)
                return
            }
            
            if let userDict = result as? NSDictionary {
                let name = userDict[&quot;name&quot;] as? String
                let id = userDict[&quot;id&quot;] as? String
                let email = userDict[&quot;email&quot;] as? String

                // HERE GIVES ERROR I DIDNT GET PICTURE WITH STRING    
                let userPicture = userDict.objectForKey(&quot;picture&quot;)?.objectForKey(&quot;data&quot;)?.objectForKey(&quot;url&quot;) as String

                print(userPicture)
                print(name as Any)
                print(id as Any)
                print(email as Any)
        }
    }
}

// Delegate Method
func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!){
    // check error
    if error != nil {
        // error happen
        print(error?.localizedDescription as Any)
        return
    }
    
    print(&quot;Successfull login in with facebook...&quot;)
    fetchProfile()
}

func loginButtonDidLogOut(_ loginButton: FBSDKLoginButton!){
    print(&quot;Log Out&quot;)
}
</code></pre>
<p>This line gives error;</p>
<blockquote>
<p>let userPicture = userDict.objectForKey(&quot;picture&quot;)?.objectForKey(&quot;data&quot;)?.objectForKey(&quot;url&quot;) as String</p>
</blockquote>
<p>Also picture object json data example here;</p>
<pre><code> picture =     {
        data =         {
            &quot;is_silhouette&quot; = 0;
            url = &quot;https://scontent.xx.fbcdn.net/v/t1.0-1/p200x200/14067524_9513823423422249533237851_n.jpg?oh=88eb9b80abbb2342346c01de298&amp;oe=58C5138B&quot;;
        };
    };
</code></pre>
<p>I'm using <code>Xcode 8.1</code> and <code>Swift 3.0</code></p>