How use uiGlassConainer

Asked on 2026-01-14

1 search

To use uiGlassContainer, you can follow these steps as outlined in the session "Build a UIKit app with the new design" from WWDC 2025:

  1. Create a UI Visual Effect View: Start by creating a UIVisualEffectView and configure it with the UI Glass Container Effect.

  2. Add Glass Views: Create your glass views and add them as subviews to your container's content view. As long as there is space between them, they appear as separate views. If they get closer, they start merging like small droplets of water.

  3. Control Interaction: Use the spacing property on the UI Glass Container Effect to control the distance at which glass views start affecting each other. When animating into an overlapping frame, glass views combine into a single shape.

  4. Dynamic Adaptation: Glass dynamically adapts to its background but maintains a consistent appearance. It can seamlessly blend between different shapes and adapt its appearance automatically when added to an existing glass container.

  5. Interactivity: For interactive elements, set isInteractive to true on the glass effect to enable interactions like scaling and bouncing.

For more detailed guidance, you can refer to the session Build a UIKit app with the new design (19:15) which covers custom elements and the use of uiGlassContainer.