Перейдите на использование API-интерфейсов расширения Swift в основных модулях.

We're merging our Swift extension SDKs into the main SDKs in order to make Swift-native APIs more broadly available and increase our ability to support new Swift language features in the future. The changes we're making and their expected impacts on your projects are documented below.

Что меняется?

Starting with Firebase for Apple SDK 10.17.0, the Swift extension SDKs have been merged into their corresponding main SDKs. For example, all of the APIs from the FirebaseFirestoreSwift module have been added to FirebaseFirestore , so you no longer have to import the FirebaseFirestoreSwift module to access those APIs.

As all Swift extensions now are part of the main modules, the extension SDKs are no longer required, and are deprecated. Including or using the Swift extension SDKs will raise a compiler warning and as early as February 2024, we'll stop releasing the Swift extensions entirely.

★ Note: Any currently or previously released versions of the Swift extensions will still function. However, we recommend that you migrate your app to use Swift APIs from the main module to ensure you continue to receive fixes and can take advantage of changes and new features.

Важные даты для этих изменений

В октябре 2023 года

Расширения Swift SDK были объединены с основными SDK, а затем объявлены устаревшими в пользу основных SDK. См. примечания к выпуску версии 10.17.0, в которых сообщается об этом изменении.

You can now use the Swift extension SDK APIs directly from the main SDK modules. Usage of the extension SDKs will is still possible until the next major version release but will raise a deprecation warning when used.

Уже в феврале 2024 года.

We'll stop releasing new versions of the Swift extensions, and we'll remove the Swift extensions from Firebase's Package.swift . Older versions will continue to function but will not receive updates.

Как перейти на использование API, разработанных специально для Swift, из основного модуля.

Если вы в настоящее время не используете SDK расширений Swift, никаких действий не требуется. Если вы используете SDK расширений Swift, внесите следующие изменения в свой проект.

Изменения в рабочем пространстве

Swift Package Manager

After updating Firebase to version 10.17.0+, navigate to the Frameworks, Libraries, and Embedded Content section in the General tab of your target's settings and remove the Swift extension SDK (such as FirebaseFirestoreSwift ).

CocoaPods

After updating Firebase to version 10.17.0+, navigate to your Podfile and remove the line corresponding to your project's dependency on adding the frameworks section for your target and remove the Swift extension SDK (such as pod FirebaseFirestoreSwift ). Then, re-run the pod install command.

Почтовое распределение и Карфаген

После обновления Firebase до версии 10.17.0 и выше удалите все расширения Swift xcframeworks в вашем проекте (например, FirebaseFirestoreSwift.xcframework ).

Изменения в исходном коде

Для всех ранее использованных вами SDK расширений Swift выполните следующие действия:

  1. Delete any import statements referencing the Swift extension SDK. If the main SDK was not imported separately, you will need to replace the Swift extension import with the main SDK import by deleting the Swift at the end of the line.
  2. If you used Swift's explicit-module namespacing to reference any Swift extension SDK types, you will need to replace those with the corresponding main SDK. For example, FirebaseFirestoreSwift.QueryPredicate would need to be renamed to FirebaseFirestore.QueryPredicate .