Skip to content

Instantly share code, notes, and snippets.

@duanebester
Created January 28, 2020 03:15
Show Gist options
  • Save duanebester/00a4edcfaba2f1e5790b7b071d628d6f to your computer and use it in GitHub Desktop.
Save duanebester/00a4edcfaba2f1e5790b7b071d628d6f to your computer and use it in GitHub Desktop.
Visual Effect View
struct VisualEffectView: UIViewRepresentable {
var effect: UIVisualEffect = UIBlurEffect(style: .systemThinMaterial)
func makeUIView(context: UIViewRepresentableContext<Self>) -> UIVisualEffectView { UIVisualEffectView() }
func updateUIView(_ uiView: UIVisualEffectView, context: UIViewRepresentableContext<Self>) { uiView.effect = effect }
}
struct VisualEffectView_Previews: PreviewProvider {
static var previews: some View {
VisualEffectView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment