Non-interactive
Templates in various sizes/shapes/positions for:
- gauge
- graphic/text
- SwiftUI view
Text updates based on face
DateFormats can autoupdate UI
- relative
- timer
- offset
Styles
- circular
- linear
Supports
- label tint
Styles
- circular
- linear
Supports
- label
- minLabel
- maxLabel
- tint
- is the default
- be careful with colors
- need to identify 2 distinct layers
- coloring is face-dependent so test in previews
Indicating foreground layer:
var body: some View {
ZStack {
Circle()
.fill(Color.blue)
Image("apple")
.foregroundColor(.yellow)
.complicationForeground() // tells us the image is the foreground
}
}
fullColor
or tinted
Use environment variable to access:
@Environment(\.complicationRenderingMode) var renderingMode
var body: some View {
ZStack {
switch renderingMode {
case .fullColor:
Circle()
.fill(Color.blue)
case .tinted:
Circle()
.fill(LinearGradient(...))
}
Image("apple")
.foregroundColor(.yellow)
.complicationForeground() // tells us the image is the foreground
}
}
- Not interactive
- SwiftUI animations not supported
- Pay attention to perf and watch out for runtime warnings
- Use default font sizes
- be aware of masks (if you use safe area this is handled for you)