Skip to content

How to build iOS framework with Swift Package Manager

Notifications You must be signed in to change notification settings

dive/spm-ios-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Summary

This is an example project for my attempts to build an iOS framework with Swift Package Manager, and re-use it in the real iOS application. It works. Mostly. But due to some restrictions and limitations, it's almost impossible to use it in the real-life environment. The whole solution is based on .xcconfig usage and some additional options for swiftc. The real story behind this repository is explained in the "Swift Package Manager builds iOS frameworks :nope:" article.

Xcode 10

How to build

cd ios-framework-package/
swift package generate-xcodeproj --xcconfig-overrides ./Sources/ios.xcconfig

Then just open ExampleApplication.xcodeproj or run the following command

open -a Xcode.app ../ExampleApplication/ExampleApplication.xcodeproj

Xcode 10.2 beta

SE-0236 was accepted and Xcode 10.2 has an updated Swift Package Manager. It means, that we do not need this hack with custom .xcconfig anymore. Check xcode_10_2_beta branch for an updated implementation.

About

How to build iOS framework with Swift Package Manager

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages