title: Facebook Login Crashes in Swift
body: <p>I have a crash problem by clicking the login button. First, I want to give the details of my application. Everything is the same as the tutorial in Facebook.</p>
  
  <p><a href="https://i.stack.imgur.com/uhf1y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uhf1y.png" alt="Files Image"></a></p>
  
  <p>ViewController.swift</p>
  
  <pre><code>import UIKit
  import Parse
  import FBSDKCoreKit
  import FBSDKLoginKit
  
  class ViewController: UIViewController {
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
      let testObject = PFObject(className: "TestObject")
      testObject["foo"] = "bar"
      testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -&gt; Void in
          print("Object has been saved.")
      }
      let loginButton: FBSDKLoginButton = FBSDKLoginButton()
      loginButton.center = self.view.center
      self.view.addSubview(loginButton)
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  }
  </code></pre>
  
  <p>AppDelegate.swift</p>
  
  <pre><code>import UIKit
  import Parse
  import Bolts
  import FBSDKCoreKit
  import FBSDKLoginKit
  
  @UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate {
  
  var window: UIWindow?
  
  func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {
      // Override point for customization after application launch.
      Parse.enableLocalDatastore()
      Parse.setApplicationId("----", clientKey: "----")
      PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions)
      return true
  }
  
  
  func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -&gt; Bool {
      return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
  }
  //...//
  }
  </code></pre>
  
  <p>I think the problem is about <code>return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)</code> case. However, I can not understand why does it crash. The error is below:</p>
  
  <p><a href="https://i.stack.imgur.com/d2uPq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d2uPq.jpg" alt="Error"></a>
  <a href="https://i.stack.imgur.com/FZyfb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FZyfb.png" alt="Total Error"></a></p>