I'm going to show you how to add a swift package to your iOS app using the Swift Package Manager.
To add a package you will need a repository’s URL or if the package is hosted on GitHub or GitHub enterprise and you’re logged in you can just search for the package.
There’s actually two ways.
- Navigate to the target’s general pane
- Click the
+button in the
Frameworks, Libraries, and Embedded Content
- Click on
Add Package Dependecy
- Open the project
- Go to the File Menu
- Choose Swift Packages and enter the repo URL
To actually use the dependency, you will need to first import the package and then call the property you want.
- Navigate to the swift packages pane in the Project settings
- Select the package to delete
- Hit the
An external dependency aka package can make your life easier as a developer. Sometimes they can save you hours of coding and figuring out how something works.
I use one in iHog for OSC a network protocol that I have no idea how to actually implement in Swift. OSCKit allowed me to focus on other parts of the app and for the package to actually handle all the OSC communication between the app, the iOS device, and the Hog controller.
If you are finding these posts and videos useful, then please share this post or buy me a coffee.