SwiftUI Visual Effects
  • July 1, 2025

View modifiers that wrap UIVisualEffectView and all of its associated objects, with environment integration for storing effect styles. Vibrancy effects will always use the current blur effect style for proper vibrancy-effect layering.

Adding and Styling a Blur Effect

YourView()
// Add a blur effect.
.blurEffect()
// Style the blur effect.
.blurEffectStyle(.systemChromeMaterial)

Adding and Styling a Vibrancy Effect

YourView()
// Add a vibrancy effect.
.vibrancyEffect()
// Style the vibrancy effect.
.vibrancyEffectStyle(.fill)

Adding and Styling Blur and Vibrancy Effects

ZStack {
YourBackgroundContent()
// Add a blur effect.
.blurEffect()

YourForegroundContent()
// Add a vibrancy effect.
.vibrancyEffect()
}
// Set the style for blur effects within this view.
.blurEffectStyle(.systemChromeMaterial)
// Set the style for vibrancy effects within this view.
.vibrancyEffectStyle(.fill)

Adding Blur and Vibrancy Effects Directly to a View


Adding both a blur and vibrancy effect directly to a view only displays the blur effect.

If you’d like to blur the view’s background content, while adding vibrancy to the view’s foreground content, use the .background() modifier, and pass BlurEffect() as its argument. Although BlurEffect may not be very Apple-like, it’s better than the .blurEffect() modifier implementation below.

YourView()
.vibrancyEffect()
.background(BlurEffect())

// as opposed to:

YourView()
.vibrancyEffect()
.background(
Color.clear
.blurEffect()
)

GitHub


View Github

#apple #ios #swift #uikit
YOU MIGHT ALSO LIKE...
TextView

Download File -> Swift Packages -> Add Package Dependency... Select your project Enter https://github.com/kenmueller/TextView for the package repository URL Select Branch: master Click Finish ...

KeyboardAvoider

 

Focuser

Focuser allows to focus SwiftUI text fields dynamically and implements ability move go through the form using Keyboard for iOS ...

OmenTextField

A better TextField for SwiftUI. A growing, multiline, auto-focusable TextField supporting bindable focus. This has been pulled out of my ...

iPhoneNumberField ☎️

Format phone numbers as they're typed—entirely in SwiftUI. 📱   Get Started | Examples | Customize | Features | Install | Pricing And it's as easy as