Get started
iOS and SwiftUI
A Swift package for iOS 16 and macOS 13 or later, built from the same tokens as the web.
Add the package
- In Xcode, open File, then Add Package Dependencies.
- Enter
https://github.com/InnerSpark/flintand pin it to a version. - The repository is private, so add your GitHub account under Xcode, Settings, Accounts first.
- Bundle the Open Sans static fonts (Regular, Medium, SemiBold, Bold, ExtraBold) and list them under
UIAppFonts.
Use it
SwiftUI
import SwiftUI
import Flint
struct TripCard: View {
var body: some View {
Text("Awning lights")
.flintText(Flint.Typography.headingH2)
.foregroundStyle(Flint.Colors.textHeading)
.padding(Flint.Space.s16)
.frame(minHeight: Flint.Target.touch)
.background(Flint.Colors.surfaceDefault,
in: RoundedRectangle(cornerRadius: Flint.Radius.card))
}
} What is in the package
| Name | What it holds |
|---|---|
Flint.Colors | Semantic colors. Each follows the system light and dark appearance. |
Flint.UIColors | The same colors as dynamic UIColor, for UIKit APIs. Flint.NSColors on macOS. |
Flint.Component | Button, input, checkbox and focus ring decisions. |
Flint.Palette | The raw ladders. Reference only. |
Flint.Typography | Type styles. Apply with .flintText(_:); they scale with Dynamic Type. |
Flint.Space, Flint.Radius | The spacing scale and radius, including Radius.control and Radius.card. |
Flint.Control, Flint.IconSize | Control heights and icon sizes. |
Flint.Target | minimum is 24 (WCAG 2.5.8). Use touch, 44 (Apple HIG), for touch UI. |
Flint.Motion | Durations and easing. animation(_:duration:reduceMotion:) returns nil when Reduce Motion is on. |
UIKit colors
UIColor(Flint.Colors.x) locks to light mode. For UIKit APIs such as navigation bar appearance, use Flint.UIColors, which switch with the appearance.
Swift
let bar = UINavigationBarAppearance()
bar.backgroundColor = Flint.UIColors.surfacePage
bar.titleTextAttributes = [.foregroundColor: Flint.UIColors.textHeading] SwiftUI components are on the way
The package ships tokens today. Buttons, notices, tags and controls proven in Bounder are moving into it (ASDS-38).