GlassEffectContainer
struct · iOS 26.0+ · SDK 27.1
@MainActor @preconcurrency struct GlassEffectContainer<Content> where Content : ViewA view that combines multiple glass shapes into a single shape that can morph individual shapes into one another. You use a glass effect container with the ``View/glassEffect(_:in)`` modifier. Each view with a glass effect contributes a shape rendered with the physical glass material to a set of shapes. SwiftUI renders the glass effects together, improving rendering performance and allowing the effects to interact with and morph into one another. Configure how the glass shapes interact with one another by customizing the default spacing value provided to the container. As shapes near one another, their paths start to blend into one another. The higher the spacing, the sooner blending begins as glass approaches each other. In the example below, the two shapes render as if they are a single continuous shape as their geometries overlaps. private let viewSize = CGSize(width: 40.0, height: 40.0) GlassEffectContainer(spacing: value) { ZStack { Image(systemName: "pencil") .frame(width: viewSize.width, height: viewSize.height) .glassEffect() .offset(x: -(viewSize.width / 2.0), y: -(viewSize.height / 2.0)) Image(systemName: "note") .frame(width: viewSize.width, height: viewSize.height) .glassEffect() .offset(x: (viewSize.width / 2.0), y: (viewSize.height / 2.0)) } } }
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
GlassEffectContainer.init(spacing:content:)
callback cannot propagate synchronous failure
GlassEffectContainer.body
This protocol needs associated types that cannot yet cross the bridge.