Creating the first SwiftUI package.

An Tran • June 12, 2019

ios swiftui swift-package-manager

Swift Package Manager has been first introduced since last WWDC. Unfortunately iOS hasn't been supported, the tooling is not well integrated into Xcode.

Everything has changed now after WWDC 2019. Xcode 11 integrates SPM directly. iOS Platform is also supported by SPM.

Xcode integration of SPM fantastic. You can not only import packages, but also create packges easily.

I have followed the session Creating Swift Packages to extract part of my code that showing a loading indicator into a separated Swift Package. Code is here: https://github.com/peacemoon/SwiftyUIView. The steps are easy to follow and very straightforward.

There are only some canveats that I want to share with you: