Skip to content

Instantly share code, notes, and snippets.

@kernjackson
Created September 5, 2020 02:04
Show Gist options
  • Select an option

  • Save kernjackson/388bc180d6526c99a4ba8d483336f5b8 to your computer and use it in GitHub Desktop.

Select an option

Save kernjackson/388bc180d6526c99a4ba8d483336f5b8 to your computer and use it in GitHub Desktop.
SwiftUI BlurView (Wrapped)
struct BlurView: UIViewRepresentable {
var style: UIBlurEffect.Style
init(_ style: UIBlurEffect.Style) {
self.style = style
}
func makeUIView(context: Context) -> UIVisualEffectView {
let view = UIVisualEffectView(effect: UIBlurEffect(style: style))
return view
}
func updateUIView(_ uiView: UIVisualEffectView, context: Context) { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment