Add SPM
Add DynamicLakeKit to a companion app and ExtensionKit extension with Swift Package Manager.
Overview
Use SPM for new DynamicLake extension projects. It keeps DynamicLakeKit versioned with the project and avoids manually copying framework builds between targets.
!Xcode Add Package Dependencies screen with the DynamicLakeKit repository selected.
Add The Package In Xcode
- Open the app project in Xcode.
- Choose File > Add Package Dependencies.
- Paste the public DynamicLakeKit repository URL.
- Select the version rule you want to use.
- Add the
DynamicLakeKitproduct to the companion app target. - Add the
DynamicLakeKitproduct to the ExtensionKit extension target.
Both targets need the package product because the companion app posts activity state and the extension renders DynamicLake UI.
Update The Package In Xcode
When a new DynamicLakeKit version is released:
- Open the app project in Xcode.
- Choose File > Packages > Update to Latest Package Versions.
- Confirm
DynamicLakeKitresolves to the expected version. - Build the companion app target and the extension target.
- Update
DynamicLakeExtensionMinimumDynamicLakeKitVersionif the extension now requires the newer SDK.
Use an exact version rule when you need fully repeatable builds. Use an up-to-next-major version rule when you want compatible DynamicLakeKit fixes to resolve automatically.
Add The Package In Package.swift
If the project is itself a Swift package, add DynamicLakeKit to dependencies:
dependencies: [
.package(name: "DynamicLakeKit", url: "https://github.com/rokach/DynamicLakeKit---Dynamic-Island-Kit-for-Mac.git", from: "1.0.0")
]
Then add the product to every target that imports DynamicLakeKit:
dependencies: [
.product(name: "DynamicLakeKit", package: "DynamicLakeKit")
]
To update from Package.swift, change the version requirement when needed, then run:
swift package update DynamicLakeKit
Verify Imports
The companion app target should compile with:
import DynamicLakeKit
The extension target should compile with:
import DynamicLakeKit
import SwiftUI
If Xcode still shows No such module 'DynamicLakeKit', confirm the package product is added to the target that owns the file with the import, then clean the build folder and rebuild.
Manual Framework Fallback
If you use a prebuilt DynamicLakeKit.framework or DynamicLakeKit.xcframework instead of SPM, link DynamicLakeKit from both targets and embed/sign it in the companion app target. SPM is preferred for public integration projects.