The simmer modifier stopped animating on Xcode 14.3 iOS 16.4. Not entirely sure why but switching onAppear to task fixes it

This commit is contained in:
Stefan Ceriu 2023-05-12 10:19:14 +03:00 committed by Stefan Ceriu
parent 23137726de
commit 966e347a1b

View File

@ -42,7 +42,7 @@ struct ShimmerModifier: ViewModifier {
func body(content: Content) -> some View {
content
.mask { gradient }
.onAppear {
.task {
withAnimation(.linear(duration: 1.75).delay(0.5).repeatForever(autoreverses: false)) {
animationTrigger.toggle()
}