Skip to content

[RFC] Add Support for Swift Package Manager (SPM) #577

@ducbm051291

Description

@ducbm051291

Issue

Our current iOS template relies on CocoaPods as the default and only supported dependency manager. While CocoaPods has served us well, a recent announcement from the CocoaPods team has significant implications:

By December 2026, the CocoaPods Specs repository will become read-only, and the CocoaPods team has officially shifted the project into maintenance mode. (Source)

This means:

  • New podspecs will no longer be accepted.
  • Existing pods won’t receive updates unless developers migrate to alternative hosting (e.g., pushing .podspec to their repo).
  • CocoaPods will no longer be actively developed, and future compatibility with Xcode or iOS SDKs may be at risk.

Continuing to rely solely on CocoaPods could result in:

  • Difficulty integrating modern libraries
  • Security vulnerabilities from outdated dependencies
  • Increasing friction for new developers used to Swift Package Manager (SPM)

In addition, as we start moving toward a modular architecture (e.g., µFeatures), SPM offers more seamless integration, better build performance, and tighter Xcode tooling.

Solution

We propose adding Swift Package Manager (SPM) as a first-class and recommended option in the iOS template.

This will include:

  • Updating the project initialization script to prompt:

“Which dependency manager would you like to use? (CocoaPods / Swift Package Manager)”

  • If CocoaPods is selected:

    • Keep the existing flow using the Podfile
  • If Swift Package Manager is selected:

    • Add equivalent dependencies in Package.swift

    • Remove Podfile and .xcworkspace

    • Use .xcodeproj with native SPM integration

    • Ensure all existing dependencies (e.g., RxSwift, Alamofire, etc.) are supported via SPM

Who Benefits

  • Developers who prefer SPM for faster, simpler, and native dependency management.

  • Projects aiming for long-term sustainability beyond CocoaPods' sunset.

  • New joiners who expect a modern and flexible setup.

What Next?

  • Update the setup script to include the dependency manager prompt.
  • Create a Package.swift that mirrors the current Podfile dependencies.
  • QA both flows: CocoaPods and SPM.
  • Update project README and setup docs to reflect the new option.
  • Gather feedback from the iOS chapter.
  • Create PRs to implement the changes. 🚀

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions