how to control styling of new glass effect in swift uikit

Asked on 06/15/2025

1 search

To control the styling of the new glass effect in UIKit, you can use the new APIs introduced in iOS 26. Here are some key points on how to customize the glass effect:

  1. Shape Customization: By default, the glass effect appears in a capsule shape. You can customize the shape using the new corner configuration API. This allows the glass to adapt its corner radius based on its position relative to its container.

  2. Appearance Adaptation: The glass effect has both dark and light appearances, which automatically adapt to the selected user interface style. It also adapts its appearance based on its size, becoming more opaque when larger and clearer when smaller.

  3. Content Integration: To add content like labels and images, use the Visual Effects view's content view. The content will automatically become vibrant based on its text color, ensuring legibility against various backgrounds.

  4. Dynamic Merging: When using multiple glass views, they can dynamically merge into a single shape when they come close to each other. This is controlled by the spacing property on the UI Glass Container Effect.

  5. Tint Color: You can assign a custom tint color to the glass effect, which will automatically adapt to a vibrant version. This can be animated alongside other glass properties.

For a detailed walkthrough on implementing these features, you can refer to the session Build a UIKit app with the new design (19:15) which covers custom elements and the use of Liquid Glass in UIKit.

how to control styling of new glass effect in swift uikit | Ask WWDC