[ad_1]
I’ve a listing of numbers that seem vertically due to an animation, I want to have auto-scroll when a brand new quantity seems however i do not know the best way to go on…I noticed some questions like this however all of them had been a ‘leap to a quantity’ resolution, not progressively scroll…any strategies?
My Code:
struct ContentView: View {
@State personal var animating = false
var physique: some View {
VStack {
ScrollView(showsIndicators: false) {
ForEach(0..<51, id: .self) { index in
Textual content("(index)")
.opacity(animating ? 1 : 0)
.animation(.easeIn(period: 0.5).delay(Double(index)), worth: animating)
}
}
}
.onAppear {
animating.toggle()
}
}
}
[ad_2]

