code is simple, when I use .opacity transition it all works well, but when I switch to .offset(x: 100, y: 100), it won't animate, I'm wondering why, anyone can help?
import SwiftUI
struct ContentView: View {
@State private var show = false
var body: some View {
VStack {
Spacer()
if show {
Text("AAAA")
.transition(
AnyTransition
// .offset(x: 100, y: 100)
.opacity
.animation(
Animation
.easeInOut(duration: 1)
.delay(5)
)
)
}
Spacer()
Button("Click") {
self.show.toggle()
}
.padding()
}
}
}