Skip to content

Instantly share code, notes, and snippets.

@zafe
Created May 1, 2017 11:13
Show Gist options
  • Select an option

  • Save zafe/f58b347ae1ef98e266a9abff940730c0 to your computer and use it in GitHub Desktop.

Select an option

Save zafe/f58b347ae1ef98e266a9abff940730c0 to your computer and use it in GitHub Desktop.
AppDelegate Facebook Login for SWIFT 3
import UIKit
import FBSDKCoreKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FBSDKApplicationDelegate.sharedInstance().application(application
, didFinishLaunchingWithOptions: launchOptions )
return true
}
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
let handled = FBSDKApplicationDelegate.sharedInstance().application(app, open: url, sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String!, annotation: options[UIApplicationOpenURLOptionsKey.annotation])
return handled
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment