what's the api to make clear glass ?

Asked on 06/12/2025

1 search

To create a clear glass effect in your app, you can use the Liquid Glass API introduced by Apple. Specifically, you can use the UIVisualEffectView with a UIGlassEffect in UIKit or the NSGlassEffectView in AppKit.

For UIKit, you can customize the glass effect using the new corner configuration API, which allows the glass to adapt its appearance based on its size and the selected user interface style. You can also add content like labels and images using the Visual Effects view's content view. Here's a brief overview of how to implement it:

  1. Create a UIVisualEffectView.
  2. Set a UIGlassEffect in an animation block to make the glass appear.
  3. Customize the shape using the corner configuration API.
  4. Add content to the glass using the content view.

For AppKit, you can use the NSGlassEffectView to place your content on glass. You can customize the appearance of the glass using properties like corner radius and tint color.

For more detailed guidance, you can refer to the session Build a UIKit app with the new design (19:15) and Build an AppKit app with the new design (17:30) from WWDC 2025.