You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**VisualEffectView** is a blur effect library with tint color support. This library uses the[UIVisualEffectView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIVisualEffectView/) to generate the blur.
10
+
**VisualEffectView** is a dynamic blur effect library with tint color support and iOS 26+ glass effects. This library uses [UIVisualEffectView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIVisualEffectView/) to generate the blur.
//Configure the view with tint color, blur radius, etc
34
-
visualEffectView.colorTint= .redColor()
33
+
//Customize the blur
34
+
visualEffectView.colorTint= .red
35
35
visualEffectView.colorTintAlpha=0.2
36
36
visualEffectView.blurRadius=10
37
37
visualEffectView.scale=1
38
38
39
39
addSubview(visualEffectView)
40
40
```
41
41
42
-
Depending on the desired effect, the effect may affect content layered behind the view or content added to the visual effect view’s contentView. After you add the visual effect view to the view hierarchy, add any subviews to the contentView property of the visual effect view. Do not add subviews directly to the visual effect view itself. Refer to the [UIVisualEffectView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIVisualEffectView/) for more info.
42
+
You can also use different styles:
43
43
44
-
For more examples, take a look at the example project.
@@ -53,28 +81,23 @@ var scale: CGFloat // scale factor. default is 1
53
81
var saturation: CGFloat // saturation factor. default is 1
54
82
```
55
83
56
-
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.
57
-
You also have to make sure you don't set `colorTintAlpha` if `colorTint` is `nil`.
84
+
**Note:** Custom blur properties only work when `style` is `.customBlur`.
58
85
59
-
### Storyboard Support
60
-
61
-
Works great with storyboards and xibs.
86
+
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`.
62
87
63
-
### SwiftUI Support
88
+
### Content View
64
89
65
-
VisualEffectView supports SwiftUI.
90
+
Add subviews to the `contentView` property, not directly to the visual effect view:
Make sure that `colorTintAlpha` is not set when `colorTint` is `nil`.
96
+
Refer to the [UIVisualEffectView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIVisualEffectView/) documentation for more info.
97
+
98
+
### Storyboard Support
99
+
100
+
Works great with storyboards and xibs.
78
101
79
102
## Installation
80
103
@@ -91,8 +114,16 @@ To install with [Carthage](https://github.com/Carthage/Carthage), simply add thi
91
114
github "efremidze/VisualEffectView"
92
115
```
93
116
117
+
### Swift Package Manager
118
+
Add VisualEffectView as a dependency in your `Package.swift` file:
0 commit comments