Semi transparent blur or frosted glass effect in SwiftUI
Created Sep 01 2020
SWIFT1import SwiftUI23struct Blur: UIViewRepresentable {4var effect: UIVisualEffect?5func makeUIView(context: UIViewRepresentableContext<Self>) -> UIVisualEffectView { UIVisualEffectView() }6func updateUIView(_ uiView: UIVisualEffectView, context: UIViewRepresentableContext<Self>) { uiView.effect = effect }7}89struct ContentView: View {10var body: some View {11ZStack {12Circle().fill(Color.orange).frame(width: 150, height: 150)13Blur(effect: UIBlurEffect(style: .light))1415}.background(Color.white).frame(maxWidth: .infinity, maxHeight: .infinity)16}17}