TechnologiesSwiftUI

LimitedAvailabilityConfiguration struct

iOSmacOStvOSwatchOSvisionOS✓ renders

A type-erased widget configuration.

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.

  1. Establish a glass region with GlassEffectContainer

    The configuration only comes into play inside a container that owns a glass region. Wrapping your content in GlassEffectContainer declares that region and gives SwiftUI the scope over which a LimitedAvailabilityConfiguration is resolved and applied as a unit.

  2. Tune the shared geometry with spacing

    The spacing: parameter on GlassEffectContainer(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.

  3. Opt views into the effect with glassEffect()

    Each child that should pick up the treatment calls .glassEffect(), as on the two Image(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.

  4. 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 the HStack of glass elements stays visually coherent.

Try it — Increase 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.

LimitedAvailabilityConfiguration.swift
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()
    }
}
Live preview
swift → lexer → parser → sema → uiir → canvas Open in Studio ↗
What's new in SwiftUI 27 →