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

  1. In Xcode, open File, then Add Package Dependencies.
  2. Enter https://github.com/InnerSpark/flint and pin it to a version.
  3. The repository is private, so add your GitHub account under Xcode, Settings, Accounts first.
  4. 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

NameWhat it holds
Flint.ColorsSemantic colors. Each follows the system light and dark appearance.
Flint.UIColorsThe same colors as dynamic UIColor, for UIKit APIs. Flint.NSColors on macOS.
Flint.ComponentButton, input, checkbox and focus ring decisions.
Flint.PaletteThe raw ladders. Reference only.
Flint.TypographyType styles. Apply with .flintText(_:); they scale with Dynamic Type.
Flint.Space, Flint.RadiusThe spacing scale and radius, including Radius.control and Radius.card.
Flint.Control, Flint.IconSizeControl heights and icon sizes.
Flint.Targetminimum is 24 (WCAG 2.5.8). Use touch, 44 (Apple HIG), for touch UI.
Flint.MotionDurations 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).