Skip to content

feat: add FirebaseStorageUISwift product for Swift SPM clients#1351

Open
demolaf wants to merge 7 commits into
fix/storage-ui-spm-firebase-11from
feat/storage-ui-swift-spm
Open

feat: add FirebaseStorageUISwift product for Swift SPM clients#1351
demolaf wants to merge 7 commits into
fix/storage-ui-spm-firebase-11from
feat/storage-ui-swift-spm

Conversation

@demolaf

@demolaf demolaf commented Jun 9, 2026

Copy link
Copy Markdown
Member

Closes #1271

Swift SPM clients currently can't call sd_setImage(with:) passing a StorageReference — the ObjC headers use @class forward declarations (required to fix the Clang scan-phase failure in #1350), which leaves StorageReference opaque to the Swift importer.

This PR adds FirebaseStorageUISwift, a new Swift-only SPM library product that bridges this gap by providing properly-typed Swift extensions on UIImageView.

Also migrates FirebaseUI-demo-swift from CocoaPods to SPM and updates StorageViewController to demonstrate the new API.

New product

Add FirebaseStorageUISwift to your SPM dependencies and import FirebaseStorageUISwift. This re-exports both FirebaseStorageUI and FirebaseStorage, so no additional imports are needed.

API Changes

extension UIImageView {

  // Without progress — trailing closure resolves to completion
  public func sd_setImageWithStorageReference(
    _ storageRef: StorageReference,
    maxImageSize size: UInt64? = nil,
    placeholderImage placeholder: UIImage? = nil,
    options: SDWebImageOptions = [],
    context: [SDWebImageContextOption: Any]? = nil,
    completion: ((UIImage?, Error?, SDImageCacheType, StorageReference) -> Void)? = nil
  )

  // With progress
  public func sd_setImageWithStorageReference(
    _ storageRef: StorageReference,
    maxImageSize size: UInt64? = nil,
    placeholderImage placeholder: UIImage? = nil,
    options: SDWebImageOptions = [],
    context: [SDWebImageContextOption: Any]? = nil,
    progress: ((Int, Int, StorageReference) -> Void)?,
    completion: ((UIImage?, Error?, SDImageCacheType, StorageReference) -> Void)? = nil
  )
}

…wift-typed API

Adds a new `FirebaseStorageUISwift` SPM library product with a Swift-only
target that provides properly-typed `sd_setImageWithStorageReference(_:)`
overloads using `StorageReference` directly, so Swift SPM clients no longer
need workarounds.

Closes #1271
@demolaf demolaf changed the base branch from main to fix/storage-ui-spm-firebase-11 June 9, 2026 15:52
@demolaf demolaf marked this pull request as draft June 9, 2026 15:52
gemini-code-assist[bot]

This comment was marked as outdated.

@demolaf demolaf marked this pull request as ready for review June 9, 2026 16:04
@demolaf demolaf marked this pull request as draft June 9, 2026 16:04
@demolaf demolaf changed the title feat(FirebaseStorageUI): add FirebaseStorageUISwift SPM product for Swift-typed API feat: add FirebaseStorageUISwift product for Swift SPM clients Jun 10, 2026
@demolaf demolaf marked this pull request as ready for review June 10, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't build project when using the Swift Package Manager

1 participant