Callstack Mike Grabowski

How Callstack Integrates Swift Package Manager with React Native Libraries

Original post Integrating Swift Package Manager with React Native Libraries

Article Summary

Mike Grabowski from Callstack shows how React Native developers can finally use Swift Package Manager alongside CocoaPods. The catch? Your entire iOS project needs dynamic frameworks.

React Native has relied on CocoaPods for years, but Apple's Swift Package Manager is the future. Since React Native 0.75, there's been a way to integrate SPM packages through the spm_dependency helper. This article walks through using both remote and local SPM packages in your React Native libraries.

Key Takeaways

Critical Insight

React Native developers can now bridge the CocoaPods and SPM ecosystems, though adopting dynamic frameworks is mandatory and may impact performance or binary size.

Continue reading

What This Article Covers

Problem

React Native libraries couldn't use local Swift packages in monorepos. The spm_dependency helper only worked with remote Git URLs, so developers had to find workarounds to handle local packages.

Solution

Callstack fixed spm_dependency to handle local packages alongside remote ones. The update uses File.exist() checks to create XCLocalSwiftPackageReference objects for local paths instead of XCRemoteSwiftPackageReference.

Impact

React Native libraries can now consume local Swift packages in monorepos with relative path resolution. You'll need to patch node_modules until React Native 0.84 comes out officially.

The article includes a patch workaround and reveals how the integration manipulates Xcode project files under the hood using CocoaPods' Xcodeproj gem.

This page summarizes “Integrating Swift Package Manager with React Native Libraries” by Callstack, published Nov 25, 2025. All credit for the original work goes to the authors.

Read the original on callstack.com (opens in new tab)

AI tools for React Native

Browse all AI tools →