Get started
Install
Two distribution modes. They can be mixed: the package for most components, copied sources for the ones you want to change.
Requirements
| Platform | Minimum | Built with | Executed on |
|---|---|---|---|
| iOS / iPadOS | 26.0 | Xcode 27.2, SDK 27.2 | iOS 26.5 simulator |
| macOS | 26.0 | Xcode 27.2, SDK 27.2 | macOS 27.3 |
| iOS 18 / macOS 15 | Not supported: no runtime was available to execute a fallback, so none is claimed. | ||
| visionOS | Not supported: the Glass API is unavailable there. | ||
Swift package
Swift tools 6.2 or later. No third-party dependency.
dependencies: [
.package(url: "https://git.spboucher.ai/sp-glasskit.git", from: "1.1.0")
],
targets: [
.target(name: "App", dependencies: [.product(name: "SPGlassKit", package: "sp-glasskit")])
]In Xcode: File → Add Package Dependencies…, enter the repository address and add the SPGlassKit library. Narrower products exist (SPGlassComponents, SPGlassForms, SPGlassData…) when only part of the catalogue is needed.
Copied sources with the CLI
spglass copies a component and the items it depends on into your project. The files import nothing from GlassKit: they compile as part of your own target.
Build the CLI
Terminal git clone https://git.spboucher.ai/sp-glasskit.git && cd sp-glasskit swift build -c release --product spglass cp .build/release/spglass /usr/local/bin/A signed and notarised binary is also listed under Downloads.
Initialise the project and add components
Terminal cd MyApp spglass init # writes spglass.json after detecting the project spglass add glass-button # installs the component and glass-foundation spglass theme add aurora spglass export --format swiftKeep it up to date, on your terms
Terminal spglass diff # your changes against the installed version spglass update --dry-run # what an update would do; modified files are never overwritten silently
In a Swift package target, declare the resources so that GlassKit's localised strings are bundled: resources: [.process("GlassKit/Core/Resources")]. In an Xcode project with synchronized folders the files are picked up automatically; spglass never edits a project file.
Integrity and authenticity
Every file is checked against the SHA-256 recorded in its manifest, and every manifest against the index. That proves a download was not altered after the index was written; it does not prove who wrote the index. When a public key is configured (--public-key or publicKey in spglass.json), the index must carry a valid Ed25519 signature. Signature status of this registry.
Minimal host application
import SwiftUI
import SPGlassKit
@main
struct DemoApp: App {
@State private var count = 0
var body: some Scene {
WindowGroup {
NavigationStack {
VStack(spacing: 16) {
GlassMetricCard("Saved", state: .loaded(GlassMetric(value: Double(count), unit: "times")))
GlassButton("Save", systemImage: "checkmark", variant: .prominent) { count += 1 }
}
.padding()
.navigationTitle("Demo")
}
.glassTheme(.ocean)
}
}
}