Updated for Xcode 12.0
The blur()
modifier lets us apply a real-time Gaussian blur to our views, at a strength of our choosing.
For example, this creates a 300x300 profile picture, then adds a 20-point Gaussian blur:
Image("paul-hudson")
.resizable()
.frame(width: 300, height: 300)
.blur(radius: 20)
You can blur anything you want, including text views:
Text("Welcome to my SwiftUI app")
.blur(radius: 2)
SPONSORED Would you describe yourself as knowledgeable, but struggling when you have to come up with your own code? Fernando Olivares has a new book containing iOS rules you can immediately apply to your coding habits to see dramatic improvements, while also teaching applied programming fundamentals seen in refactored code from published apps.
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.