Swift Package Manager for pre-iOS 13

In WWDC19, Apple announced the support for Swift Package Manager for all of Apple's platforms, including iOS. I know it will work with Xcode 11 for iOS 13, but I have only found limited findings regarding the details around it.

  1. Will we be able to use SPM for our apps/SDKs if we have a deployment target before iOS 13?
  2. Integrating .xcframeworks with SPM will work for integrators on Xcode 11. However, will they be able to create apps using .xcframeworks for devices that are on pre-iOS 13?
  3. Regarding normal .frameworks and SPM, will we be able to use SPM to host .frameworks that will be used on devices that are on pre-iOS 13?
  4. Are there any misc concerns to watch out for if my SDK is in Objective-C and I wish to create a framework and put it into SPM?

Swift packages and therefore SPM in Xcode are not bound to any iOS version. You can use it for targets before iOS 13.

SPM works perfectly with Objective C code.

Per some of your questions, according to discussion on the swift.org forums, SPM does not currently support pre-built binary xcframeworks, nor any binary distribution... not even resources. You might want to clarify your questions, as you may be referring to SPM building of an xcframework from source, vs. distribution of a pre-built xcframework binary via SPM.


If you visit swift . org's forums and search for xcframework, you'll find a pitch for adding support for binary frameworks to SPM.


Also, Google's Firebase team looked into supporting SPM for their frameworks and came up with a fascinating list of roadblocks. See their firebase-ios-sdk on github, issue# 3136.


I too wonder if an xcframework can be used in an app with deploy target before iOS 13.


I've successfully used SPM in Xcode 11 beta 5 to create Realm and RealmSwift (3.17.3), and I noticed that the resulting embeds into my app target just say "Realm" and "RealmSwift", with no extension, and with an icon (white Roman building) that doesn't appear to relate to a framework. I have a feeling that these are not xcframeworks at all. If I build Realm directly via command line using their repo, I do get an xcframework.


If you find any Apple links at all about xcframeworks, or even 3rd party guides, please post them here. I've yet to find anything beyond the WWDC 19 video.

The limitation referred to in the other answer is now lifted. Swift Packages can now include resources and frameworks.
Swift Package Manager for pre-iOS 13
 
 
Q