I have my animation for the rotation working beautifully, but the image is also moving vertically. Why?
struct SyncView: View {
@State var isSyncing = false
let animation: Animation = Animation.linear(duration: 2.0).repeatForever(autoreverses: false)
var body: some View {
VStack(spacing: 16) {
HStack {
VStack(alignment: .leading) {
Text("Linked Device's Name")
Text("Updating (Last update: Oct 1, 2022)")
.font(.callout)
.foregroundColor(.gray)
}
Spacer()
Text(Image(systemName: "arrow.triangle.2.circlepath"))
.foregroundStyle(Color.yellow)
.font(.title)
.rotationEffect(Angle.degrees(isSyncing ? 360 : 0))
.animation(animation, value: isSyncing)
}
}
.padding()
.onAppear {
isSyncing = true
}
}
}