how to get more clear glass effect, so it can passthrough text uikit

Asked on 06/15/2025

1 search

To achieve a clearer glass effect in UIKit that allows text to pass through, you can utilize the new Liquid Glass material introduced in iOS 26. Here are some steps and tips based on the WWDC sessions:

  1. Use the Visual Effects View: Create a UIVisualEffectView and apply the new UIGlassEffect. This will give you the glass appearance.

  2. Customize the Glass Effect: You can customize the shape of the glass using the new corner configuration API. By default, the glass is in a capsule shape, but you can adjust it to fit your design needs.

  3. Adaptive Appearance: The glass effect automatically adapts to light and dark modes to increase contrast, which helps in maintaining text legibility.

  4. Content View: Add your text or other content to the contentView of the UIVisualEffectView. The text will automatically become vibrant based on its color, ensuring legibility against various backgrounds.

  5. Opacity and Tint: For a clearer effect, you can adjust the opacity and use a custom tint color. The glass effect can be animated to transition between different states, which can help in maintaining clarity.

  6. Interactive Elements: If you have interactive elements, set isInteractive to true on the glass effect to ensure that it responds to user interactions.

For more detailed guidance, you can refer to the session Build a UIKit app with the new design (19:15) where custom elements and the glass effect are discussed.