/AnimatedScrollView

A customized ScrollView can add item transition when scrolling. Support iOS 14+, macOS 11+

Primary LanguageSwift

AnimatedScrollView

A customized ScrollView can add item transition when scrolling.

Support iOS 14+, macOS 11+

demo

Installation

Swift Package Manager

.package(url: "https://github.com/lewislee922/AnimatedScrollView.git", from: "1.0.6")

Then import AnimatedScrollView in any Swift file in your module.

Usage

Example

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)
        }
    }
}