A customized ScrollView can add item transition when scrolling.
Support iOS 14+, macOS 11+
.package(url: "https://github.com/lewislee922/AnimatedScrollView.git", from: "1.0.6")
Then import AnimatedScrollView
in any Swift file in your module.
struct YourView: View {
private let hashableArray = (0..<100).map { index in
"\(index)"
}
var body: some View {
AnimatedScrollView(items: hashableArray) { item, transitionState in
Text(item)
.font(.title)
.opacity(1-transitionState)
.scaleEffect(1-transitionState)
}
}
}