Installation
Add the package
swift-common is distributed as a SwiftPM package via its Git URL. It is not published to a registry; pin to a branch or a release tag.
Package.swift
// In your Package.swift `dependencies:` array
.package(url: "https://github.com/rtorcato/swift-common", branch: "main"),
Then add the products you need to your target's dependencies:
// Just the utilities
.product(name: "MatrixSwiftBaseCore", package: "swift-common"),
// Utilities + SwiftUI primitives
.product(name: "MatrixSwiftBaseCore", package: "swift-common"),
.product(name: "MatrixSwiftBaseUI", package: "swift-common"),
// Lottie animation views (adds the lottie-ios dependency; not for watchOS)
.product(name: "MatrixSwiftBaseLottie", package: "swift-common"),
Xcode
- File → Add Package Dependencies…
- Paste
https://github.com/rtorcato/swift-commonin the search field. - Select which product(s) to link —
MatrixSwiftBaseCore,MatrixSwiftBaseUI,MatrixSwiftBaseLottie.
Import
Import only the modules you actually use:
import MatrixSwiftBaseCore
// only if you need the SwiftUI primitives
import MatrixSwiftBaseUI
// only if you need the Lottie views
import MatrixSwiftBaseLottie
Requirements
- Swift: 5.9+
- Xcode: 15+
- Platforms: iOS 16+, macOS 13+, tvOS 16+, watchOS 9+ — see the platform support guide.
Pinning to a release
Releases are tagged; tags are batched and cut when a milestone closes. Until a tag covers what you need, vendored consumers can track main. Pin a version tag so updates are deliberate:
.package(url: "https://github.com/rtorcato/swift-common", from: "0.1.0"),