Created
January 28, 2020 03:15
-
-
Save duanebester/00a4edcfaba2f1e5790b7b071d628d6f to your computer and use it in GitHub Desktop.
Visual Effect View
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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