struct AniTestView: View {
@State var offset: CGFloat = 0
var body: some View {
Color.red
.frame(width: 100, height: 100)
.offset(x: offset)
.onAppear {
withAnimation(.linear(duration: 4)) {
offset = 200
} completion: {
print("done")
}
}
}
}
The completion callback of withAnimation(_:completion:) does not take effect.
The animation itself runs as expected, but the completion closure is never called.