SwiftUI: fade out view – Ios swift
I have the following code: struct ContentView: View { @State var show = false var body: some View { VStack { ZStack { Color.black if show { RoundedRectangle(cornerRadius: 20) .fill(.brown) .transition(.opacity) } } Button { withAnimation(.easeInOut(duration: 1)) { show.toggle() }…