Migrate to the latest Firebase SDK for Swift (v4.0.0)

In version 4.0.0 of the Firebase iOS SDK for Swift, we included changes to follow the naming conventions in the Swift API Design Guidelines. To fix any errors or warnings you might receive when you update your app's version of the Firebase iOS SDK, follow the steps in this migration guide.

Changes in the new version

The following changes have been made to the Swift SDK across all Firebase products:

  • Removing the FIR prefix across names for all constants, protocols, classes, enums, and type definitions.
  • Renaming FIRApp to FirebaseApp.
  • Renaming FIROptions to FirebaseOptions.

For a full list of the changes, see the detailed list of changes section.

Resolve errors

The best way to resolve errors resulting from these changes is to use the Fix-it dialog in Xcode.

  1. When you open your updated project in your Xcode workspace, errors resulting from the naming changes appear in the issue navigator.
  2. Click the error and resolve it with the suggestion in the Fix-it dialog.

Resolve naming conflicts

To resolve naming conflicts, use the namespace provided by the module. For example, in the case of FIRUser, which is now User, you may want to differentiate between your User class/struct and the Firebase User class.

@import Firebase
...
var firebaseUser: Firebase.User?

Detailed list of changes