From 0051d4942df188a24ea2fa8ca6b745ee873b52b4 Mon Sep 17 00:00:00 2001 From: Avery Pace Date: Mon, 8 Nov 2021 12:33:39 -0500 Subject: [PATCH] Animation fixed in flash cards --- Toki Trainer/Views/FlashCardView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Toki Trainer/Views/FlashCardView.swift b/Toki Trainer/Views/FlashCardView.swift index 8b5dcad..6096306 100644 --- a/Toki Trainer/Views/FlashCardView.swift +++ b/Toki Trainer/Views/FlashCardView.swift @@ -76,6 +76,7 @@ struct FlashCardStack: View { ForEach(flashCards.indices, id: \.self) { index in flashCards[index] .offset(x: 0, y: flashCardsVertOffset[index]) + .animation(.default, value: flashCardsVertOffset[index]) .zIndex(-(CGFloat(index * 10))) } } @@ -242,7 +243,7 @@ struct FlashCard: View { .rotationEffect(.degrees(isFaceDown ? -(dragAmount / 50) : dragAmount / 50)) .font(.title) .rotation3DEffect(self.isFaceDown ? Angle(degrees: 180) : Angle(degrees: 0), axis: (x: 0.0, y: 10.0, z: 0.0)) - .animation(.default) + .animation(.default, value: isFaceDown) .onTapGesture { if self.isInteractive == true { self.isFaceDown.toggle()