How far should a SwiftUI app adopt Liquid Glass and custom effects in its own components, versus system controls, when it still deploys back to iOS 17?
answer
- standard components already use it
- availability branch and fallback
- legibility over real content
- Reduce Transparency, Increase Contrast
- limit effects, group them
basics
~20 sLet system controls carry Liquid Glass, which standard SwiftUI components already use, and keep glassEffect to a short list of custom floating controls behind #available with a Material fallback. Check every custom surface for legibility and under accessibility settings.
solid answer
~50 sI start from what is free: Apple's documentation says standard SwiftUI components use Liquid Glass, so bars, toolbars and system buttons get it, along with whatever adaptation Apple ships. Custom glass costs more: `glassEffect(_:in:)` and `GlassEffectContainer` are iOS 26 APIs, so with an iOS 17 deployment target each use needs an `#available` branch and a fallback, usually a `Material`, which means two looks to design and test. Glass shows what is behind it, so I check legibility over real photos and with Reduce Transparency and Increase Contrast on; a custom effect honours those only if our code reads them. Apple also advises limiting glass effects onscreen and grouping them in a container. My rule is: system controls first, custom glass only for floating controls over content, never on content itself, and each effect shipped as one design-system component with its fallback.
code
swift · 26 linesimport SwiftUI
struct WorkoutControlBackground: ViewModifier {
func body(content: Content) -> some View {
if #available(iOS 26.0, *) {
content
.glassEffect(.regular.interactive(), in: .rect(cornerRadius: 20))
} else {
content
.background(.regularMaterial, in: .rect(cornerRadius: 20))
}
}
}
struct WorkoutControls: View {
var body: some View {
HStack(spacing: 24) {
Button("Pause", systemImage: "pause.fill") {}
Button("End", systemImage: "stop.fill", role: .destructive) {}
}
.labelStyle(.iconOnly)
.font(.title2)
.padding()
.modifier(WorkoutControlBackground())
}
}go deeper
Recall that Liquid Glass arrived in iOS 26, that standard components already use it, and that glassEffect(_:in:) adds it to a custom view.
Explain availability checks with a Material fallback, glassEffect's default capsule shape and regular variant, and why a GlassEffectContainer groups effects.
Show you test glass and custom effects over real content, with accessibility settings on, on the oldest supported device, and keep the availability branch in one place.
Own the adoption policy: which components may use custom glass or shaders, what each costs in design, testing and maintenance across OS versions, and what evidence would change the rule.
## What the system already gives you **Liquid Glass** is the material Apple introduced in iOS 26: it blurs content behind it, reflects surrounding colour and light, and reacts to touch. Apple's documentation states that standard SwiftUI components use it, and the Landmarks sample shows the system applying it to toolbar items automatically. Buttons opt in with `buttonStyle(.glass)` or `.glassProminent`. So the first part of the decision is free: navigation bars, tab bars, toolbars, sheets and system buttons carry the new look, and whatever adaptation Apple ships for them arrives with each OS update. Every custom effect you add is code you design, test and maintain against that moving baseline. ## What custom adoption costs `glassEffect(_:in:)`, `GlassEffectContainer`, `glassEffectID(_:in:)` and `glassEffectUnion(id:namespace:)` are all **iOS 26** APIs. For an app that still deploys to iOS 17, every custom glass surface means: - an `if #available(iOS 26.0, *)` branch, because calling `glassEffect` unconditionally does not compile; - a fallback look for iOS 17 to 25, usually a `Material` or an opaque fill; - two designs to review and two sets of screenshots to test; - legibility checks over real photos, since glass shows what lies behind it; - performance care: Apple's guidance is to limit the number of glass effects onscreen and to group them in a `GlassEffectContainer`, because many separate effects can degrade rendering. Shaders through `colorEffect` and `layerEffect` (iOS 17) and `MeshGradient` (iOS 18) carry similar costs on a smaller scale: Metal code to own, older-OS fallbacks, and accessibility behaviour you must write yourself. ## A tiered policy Writing the rule down matters more than the exact list: without one, each feature team adds its own glass card, the number of effects onscreen climbs, and the fallback paths drift apart. A lead usually turns this into a short written rule for the design system: 1. **System first**: use standard controls and bars wherever they fit, and let them carry Liquid Glass. 2. **Glass for floating controls only**: custom glass is allowed on a short list of components that sit above content, such as the in-workout pause and stop controls or metric chips over a map. 3. **No glass on content**: cards, lists and charts stay opaque or use a plain `Material`, so content never competes with controls. 4. **One celebratory effect at most**: a shader or mesh gradient for a moment like closing all rings, behind an availability check and `isEnabled`. 5. **Each custom effect ships as a component** with its fallback, accessibility handling and preview states, not as ad-hoc modifiers per screen. ## Version strategy | Capability | iOS 17 | iOS 18 | iOS 26 and later | |---|---|---|---| | `Material` backgrounds | yes | yes | yes | | Shader effects | yes | yes, plus `Shader.compile(as:)` | yes | | `MeshGradient` | fallback needed | yes | yes | | `glassEffect`, `GlassEffectContainer` | fallback needed | fallback needed | yes | Wrapping the branch in one `ViewModifier` keeps the `#available` check in a single place, so raising the deployment target later deletes one branch instead of touching every screen. ## Legibility and accessibility Translucency trades contrast for depth. Each custom surface should be checked with **Reduce Transparency** and **Increase Contrast** turned on, in light and dark appearance, over the busiest real content it can sit on. SwiftUI exposes the settings as `accessibilityReduceTransparency` and `colorSchemeContrast`; Apple's documentation for the former says backgrounds should be opaque when it is on. A hand-built material or shader honours these only if your code reads them. Tinting glass with `Glass.tint(_:)` signals prominence; using it on everything removes the signal. ## Using the container well ```swift import SwiftUI @available(iOS 26.0, *) struct MetricChips: View { @Namespace private var namespace var showsPace: Bool var body: some View { GlassEffectContainer(spacing: 16) { HStack(spacing: 16) { Label("142 bpm", systemImage: "heart.fill") .padding(12) .glassEffect() .glassEffectID("heart", in: namespace) if showsPace { Label("5:02 /km", systemImage: "speedometer") .padding(12) .glassEffect() .glassEffectID("pace", in: namespace) } } } } } ``` Two details from Apple's documentation shape how these chips look. The glass is anchored to the view's bounds, so it covers the padding as well as the label, and the default shape is a capsule unless you pass one with `in:`. The container renders its glass shapes together, and with IDs from a namespace the chips can morph when one appears or disappears inside an animation. Apple's documentation asks that `glassEffect` come after the other modifiers that affect a view's appearance, because it captures the content it is applied to.
- Why group several glass views in a GlassEffectContainer?Apple's documentation says a container gives the best rendering performance when several views use Liquid Glass, and lets their shapes blend and morph into one another. The container's `spacing` sets how close shapes must be before they start to merge; with `glassEffectID(_:in:)` the shapes morph during transitions as views appear or disappear.
- Which Glass options would you allow in the design system, and why so few?`Glass.regular` is the default, and `.clear` and `.identity` are the other variants the type declares; `tint(_:)` suggests prominence and `interactive(_:)` makes a custom control react to touch like a system button. I would allow regular glass, interactive on tappable controls, and a tint only for the single primary action, because tinting everything removes the prominence signal.
- What would make you widen custom glass adoption later?Raising the deployment target to iOS 26, which deletes every fallback branch; evidence from accessibility testing that the surfaces stay legible; and rendering measurements on the oldest supported device showing the effects stay smooth. Until then the cost of two looks per component argues for a short list.
- Every custom view should get glassEffect so the app looks current
- glassEffect can be called unconditionally in an app deploying to iOS 17
- Glass surfaces need no testing with Reduce Transparency or Increase Contrast
- Many separate glass effects onscreen cost nothing extra to render
- Apply glassEffect first, before modifiers that shape the view's appearance
Assumes the iOS 27 SDK with an iOS 17 deployment target; glassEffect, Glass and GlassEffectContainer arrived in iOS 26, MeshGradient in iOS 18, shader effects in iOS 17.