In swiftui, how do i implement two buttons? such that one button uses regular glass and another uses liquid glass?
Asked on 2025-06-12
1 search
To implement two buttons in SwiftUI, where one uses regular glass and the other uses liquid glass, you can use the new button styles introduced in the WWDC 2025 session "Build a SwiftUI app with the new design." Here's a basic example of how you might set this up:
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
// Regular Glass Button
Button(action: {
// Action for regular glass button
}) {
Text("Regular Glass Button")
}
.buttonStyle(GlassButtonStyle()) // Use the regular glass style
// Liquid Glass Button
Button(action: {
// Action for liquid glass button
}) {
Text("Liquid Glass Button")
}
.buttonStyle(LiquidGlassButtonStyle()) // Use the liquid glass style
}
}
}
In this example, GlassButtonStyle
and LiquidGlassButtonStyle
are hypothetical styles based on the session's description. You would replace these with the actual styles provided by SwiftUI for glass and liquid glass effects.
For more detailed information on implementing these styles, you can refer to the session Build a SwiftUI app with the new design (17:57) where Liquid Glass effects are discussed.

Build a SwiftUI app with the new design
Explore the ways Liquid Glass transforms the look and feel of your app. Discover how this stunning new material enhances toolbars, controls, and app structures across platforms, providing delightful interactions and seamlessly integrating your app with the system. Learn how to adopt new APIs that can help you make the most of Liquid Glass.

Build a UIKit app with the new design
Update your UIKit app to take full advantage of the new design system. We’ll dive into key changes to tab views, split views, bars, presentations, search, and controls, and show you how to use Liquid Glass in your custom UI. To get the most out of this video, we recommend first watching “Get to know the new design system” for general design guidance.

Meet Liquid Glass
Liquid Glass unifies Apple platform design language while providing a more dynamic and expressive user experience. Get to know the design principles of Liquid Glass, explore its core optical and physical properties, and learn where to use it and why.