How to apply Liquid Glass effect to UIButton

Asked on 2025-07-31

1 search

To apply the Liquid Glass effect to a UIButton in a UIKit app, you can follow these steps:

  1. Use the Glass Configuration: UIKit provides new glass appearances for buttons. You can use the UIButtonConfiguration to apply these appearances. There are two types of glass configurations: standard glass and prominent glass, which is tinted with your app's tint color.

  2. Create a UI Visual Effect View: For custom views, you can create a UIVisualEffectView and apply a new UI glass effect within an animation block. This allows the glass to appear using a special materialized animation.

  3. Customize the Shape: By default, the glass effect is in a capsule shape. You can customize this shape using the new corner properties.

  4. Interactivity: To make the button interactive, set isInteractive to true on the glass effect. This will allow the button to scale and bounce when tapped, providing a more engaging user experience.

  5. Animation: When you no longer need the glass on screen, animate it out by setting the effect to nil. This ensures that the glass dematerializes with the appropriate animation.

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 use of Liquid Glass are discussed.