How it works
LimitedAvailabilityConfiguration is the configuration value SwiftUI hands to a glass-effect container when it needs to describe how its Liquid Glass treatment behaves on platforms or in contexts where the full effect isn't available. It lets the framework reconcile the desired glass appearance with the rendering capabilities at hand, so a single view hierarchy can request rich glass and still degrade gracefully. Reach for it when you build or coordinate glass effects through a container and want the system, rather than your own branching code, to decide what renders where.
Establish a glass region with GlassEffectContainer
The configuration only comes into play inside a container that owns a glass region. Wrapping your content in
GlassEffectContainerdeclares that region and gives SwiftUI the scope over which aLimitedAvailabilityConfigurationis resolved and applied as a unit.Tune the shared geometry with spacing
The
spacing:parameter onGlassEffectContainer(spacing: 16)controls how closely the container packs and blends the glass shapes it manages. This spacing feeds the same configuration that governs the effect, so neighboring elements merge or separate consistently rather than each negotiating availability on its own.Opt views into the effect with glassEffect()
Each child that should pick up the treatment calls
.glassEffect(), as on the twoImage(systemName:)views here. The modifier enrolls that view in the container's configuration, and where the full Liquid Glass appearance can't be produced, the limited-availability path determines the fallback for that view automatically.Let one configuration coordinate multiple effects
Because both starred and hearted images sit in the same
GlassEffectContainer, they share one resolved configuration instead of independent ones. This is the central role of the symbol: it carries the availability decision across the whole region so theHStackof glass elements stays visually coherent.
GlassEffectContainer(spacing: 16) to a much larger value like 64 and watch the two glassEffect() images stop blending into a shared glass region and render as separate, individually configured shapes.Example & preview
Press Run live & edit to compile it in your browser — then edit the Swift on the left and the preview re-renders live.
struct LimitedAvailabilityConfigurationDemo: View {
var body: some View {
GlassEffectContainer(spacing: 16) {
HStack(spacing: 16) {
Image(systemName: "star.fill")
.font(.title)
.padding()
.glassEffect()
Image(systemName: "heart.fill")
.font(.title)
.padding()
.glassEffect()
}
}
.padding()
}
}