Dynamic blur background view with tint color (UIVisualEffectView subclass) π±
Swift
1,424
194 commits
updated Dec 29, 2025
VisualEffectView is a dynamic blur effect library with tint color support and iOS 26+ glass effects. This library uses UIVisualEffectView to generate the blur.
$ pod try VisualEffectView
import VisualEffectView
let visualEffectView = VisualEffectView(frame: CGRect(x: 0, y: 0, width: 320, height: 480))
// Customize the blur
visualEffectView.colorTint = .red
visualEffectView.colorTintAlpha = 0.2
visualEffectView.blurRadius = 10
visualEffectView.scale = 1
addSubview(visualEffectView)
You can also use different styles:
// System blur
visualEffectView.style = .systemBlur(.dark)
// Glass effect (iOS 26+)
visualEffectView.style = .glass(.regular)
// Custom blur (default)
visualEffectView.style = .customBlur
import VisualEffectView
struct ContentView: View {
var body: some View {
VisualEffect(colorTint: .white, colorTintAlpha: 0.5, blurRadius: 18, scale: 1)
}
}
Or use the style-based API:
VisualEffect(style: .glass(.regular))
VisualEffect(style: .systemBlur(.dark))
var colorTint: UIColor // tint color. default is nil
var colorTintAlpha: CGFloat // tint color alpha. default is 0
var blurRadius: CGFloat // blur radius. default is 0
var scale: CGFloat // scale factor. default is 1
var saturation: CGFloat // saturation factor. default is 1
Note: Custom blur properties only work when style is .customBlur.
If you want colorTintAlpha to be different from 0, make sure you always set it right after setting the colorTint or it may not be applied as expected. Don't set colorTintAlpha if colorTint is nil.
Add subviews to the contentView property, not directly to the visual effect view:
visualEffectView.contentView.addSubview(label)
Refer to the UIVisualEffectView documentation for more info.
Works great with storyboards and xibs.
To install with CocoaPods, simply add this in your Podfile:
use_frameworks!
pod "VisualEffectView"
To install with Carthage, simply add this in your Cartfile:
github "efremidze/VisualEffectView"
Add VisualEffectView as a dependency in your Package.swift file:
dependencies: [
.package(url: "https://github.com/efremidze/VisualEffectView.git", from: "6.0.0")
]
VisualEffectView utilizes a private UIKit API to do its magic. Use caution, submitting this code to the App Store adds the risk of being rejected!
The .systemBlur() and .glass() styles use only public APIs and are safe for App Store submission.
https://github.com/collinhundley/APCustomBlurView
VisualEffectView is available under the MIT license. See the LICENSE file for more info.
129 followers Β· starred May 2025
124 followers Β· starred Jul 2025
444 followers Β· starred Feb 2020
213 followers Β· starred Jul 2020
Dynamic blur background view with tint color (UIVisualEffectView subclass) π±
Swift
1,424
194 commits
updated Dec 29, 2025
VisualEffectView is a dynamic blur effect library with tint color support and iOS 26+ glass effects. This library uses UIVisualEffectView to generate the blur.
$ pod try VisualEffectView
import VisualEffectView
let visualEffectView = VisualEffectView(frame: CGRect(x: 0, y: 0, width: 320, height: 480))
// Customize the blur
visualEffectView.colorTint = .red
visualEffectView.colorTintAlpha = 0.2
visualEffectView.blurRadius = 10
visualEffectView.scale = 1
addSubview(visualEffectView)
You can also use different styles:
// System blur
visualEffectView.style = .systemBlur(.dark)
// Glass effect (iOS 26+)
visualEffectView.style = .glass(.regular)
// Custom blur (default)
visualEffectView.style = .customBlur
import VisualEffectView
struct ContentView: View {
var body: some View {
VisualEffect(colorTint: .white, colorTintAlpha: 0.5, blurRadius: 18, scale: 1)
}
}
Or use the style-based API:
VisualEffect(style: .glass(.regular))
VisualEffect(style: .systemBlur(.dark))
var colorTint: UIColor // tint color. default is nil
var colorTintAlpha: CGFloat // tint color alpha. default is 0
var blurRadius: CGFloat // blur radius. default is 0
var scale: CGFloat // scale factor. default is 1
var saturation: CGFloat // saturation factor. default is 1
Note: Custom blur properties only work when style is .customBlur.
If you want colorTintAlpha to be different from 0, make sure you always set it right after setting the colorTint or it may not be applied as expected. Don't set colorTintAlpha if colorTint is nil.
Add subviews to the contentView property, not directly to the visual effect view:
visualEffectView.contentView.addSubview(label)
Refer to the UIVisualEffectView documentation for more info.
Works great with storyboards and xibs.
To install with CocoaPods, simply add this in your Podfile:
use_frameworks!
pod "VisualEffectView"
To install with Carthage, simply add this in your Cartfile:
github "efremidze/VisualEffectView"
Add VisualEffectView as a dependency in your Package.swift file:
dependencies: [
.package(url: "https://github.com/efremidze/VisualEffectView.git", from: "6.0.0")
]
VisualEffectView utilizes a private UIKit API to do its magic. Use caution, submitting this code to the App Store adds the risk of being rejected!
The .systemBlur() and .glass() styles use only public APIs and are safe for App Store submission.
https://github.com/collinhundley/APCustomBlurView
VisualEffectView is available under the MIT license. See the LICENSE file for more info.
129 followers Β· starred May 2025
124 followers Β· starred Jul 2025
444 followers Β· starred Feb 2020
213 followers Β· starred Jul 2020