@sbaiahmed1/react-native-blur 4.6.1-beta.5 → 4.6.1-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import UIKit
|
|
2
|
+
import SwiftUI
|
|
2
3
|
|
|
3
4
|
class BlurEffectView: UIVisualEffectView {
|
|
4
5
|
private var animator: UIViewPropertyAnimator?
|
|
@@ -66,3 +67,18 @@ private func isDetoxPresent() -> Bool {
|
|
|
66
67
|
let args = ProcessInfo.processInfo.arguments
|
|
67
68
|
return args.contains("-detoxServer") && args.contains("-detoxSessionId")
|
|
68
69
|
}
|
|
70
|
+
|
|
71
|
+
struct Blur: UIViewRepresentable {
|
|
72
|
+
var style: UIBlurEffect.Style = .systemMaterial
|
|
73
|
+
var intensity: Double = 1.0
|
|
74
|
+
|
|
75
|
+
func makeUIView(context: Context) -> BlurEffectView {
|
|
76
|
+
let effectView = BlurEffectView(effect: nil)
|
|
77
|
+
effectView.updateBlur(style: style, intensity: intensity)
|
|
78
|
+
return effectView
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
func updateUIView(_ uiView: BlurEffectView, context: Context) {
|
|
82
|
+
uiView.updateBlur(style: style, intensity: intensity)
|
|
83
|
+
}
|
|
84
|
+
}
|