Skip to content

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

Notifications You must be signed in to change notification settings

lewislee922/AnimatedScrollView

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages