title: What Is the Code to Install FirebaseUI on iOS (Swift)
body: <p>I'm trying to install the <a href="https://github.com/firebase/FirebaseUI-iOS" rel="nofollow">"drop-in" authentication solution</a> from <a href="https://firebase.google.com/docs/auth/" rel="nofollow">Firebase</a> that automatically sends your app users through Google, Facebook, or email/password screens to authenticate them.</p>
  
  <p>My problem is that the code provided by Firebase appears to be in the old iOS language of Objective C instead of Swift, and that some of the lines of instructional Swift code appear outdated, and I can't find the new lines I'm supposed to use.</p>
  
  <p>I'm building my code mostly from the instructions on this part of the Github drop-in solution: <a href="https://github.com/firebase/FirebaseUI-iOS/tree/master/FirebaseUI/Auth" rel="nofollow">FirebaseUI Authentication</a>.</p>
  
  <p>This has resulted in the following code, some of which I've had to guess at, since Xcode couldn't recognize <code>.authUI()</code> in <code>let authUI = FIRAuthUI.authUI()</code>. The app doesn't crash, but it's not starting the authentication process at all, either. It's just a blank screen.</p>
  
  <pre><code>import UIKit
  import Firebase
  import FirebaseAuth
  import FirebaseDatabaseUI
  import FirebaseAuthUI
  import FirebaseGoogleAuthUI
  import FirebaseFacebookAuthUI
  import FBSDKCoreKit
  import FBSDKLoginKit
  
  class LoginController: UIViewController, FIRAuthUIDelegate {
  
  var db = FIRDatabaseReference.init()
  var kFacebookAppID = "15839856152xxxxx"
  var kGoogleClientID = "9042861xxxxx-6qq4gmeos07gpgmgt54ospv3fvpg0724.apps.googleusercontent.com"
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      //FIRApp.configure()
      let authUI = FIRAuthUI.defaultAuthUI()
  
      let facebookAuthUI = FIRFacebookAuthUI(appID: kFacebookAppID)
      let googleAuthUI = FIRGoogleAuthUI(clientID: kGoogleClientID)
      //let emailAuthUI = FIREmailPasswordAuthProvider
  
      authUI?.providers = [facebookAuthUI, googleAuthUI]
  
      // Present the auth view controller and then implement the sign in callback.
      let authViewController = authUI
      authUI?.authViewController()
  
  }
  
  func authUI(authUI: FIRAuthUI, didSignInWithUser user: FIRUser?, error: NSError?) {
      if error != nil {
          //Problem signing in
      }else {
          //User is in!
      }
  }
  
  func application(app: UIApplication, openURL url: NSURL, options: [String: AnyObject]) -&gt; Bool {
      let sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey] as! String
      return FIRAuthUI.defaultAuthUI()!.handleOpenURL(url, sourceApplication: sourceApplication ?? "") ?? false
  }
  
  }
  </code></pre>
  
  <p>As a side not, I placed <code>FIRApp.configure()</code> inside the "didFinishLaunchingWithOptions" function in the AppDelegate class, and I have also separated <code>FIRApp.configure()</code> out as an override in the AppDelegate class, as shown below. Nothing seems to help. I've spent about 4 days trying to figure this out. Implementing it for Web and Android only took a few hours.</p>
  
  <pre><code>override init() {
      super.init()
      FIRApp.configure()
      //FIRDatabase.database().persistenceEnabled = true
  }
  </code></pre>