When I "toggle cover" the red view should transition away off the bottom of the screen to reveal the green view.
When I "toggle cover" again the red view should transition up from the bottom of the screen to cover the green view.
I have this working in the below code, but to make it work I need to use weird scale: 0.9999 value. Is there a better way to do this?
I tried using .identity transition. I also tried using .scale(scale: 1.0), but in both cases the green view disappears early... can anyone tell me what's going on?
Code Block swift import SwiftUI struct TestCoverView: View { @State private var showCover = true var body: some View { VStack { Button("Toggle Cover") { withAnimation { showCover.toggle() } } if (showCover) { Color.red .edgesIgnoringSafeArea(.all) .transition(.move(edge: .bottom)) .zIndex(1) } else { Color.green .edgesIgnoringSafeArea(.all) .transition(.scale(scale: 0.9999)) } } } }