Skip to content

urbi-mobility/LegacyScrollView

 
 

Repository files navigation

LegacyScrollView

A legacy UIScrollView wrapper for SwiftUI.

Installation

For Swift Packages

Add a dependency in your your Package.swift

    .package(name: "LegacyScrollView", url: "https://github.com/bwide/LegacyScrollView", from: "1.0.0")

Usage:

            LegacyScrollView(.vertical, showsIndicators: true) {
                content
            }
            .onGestureShouldBegin { pan, scrollView in
                pan.translation(in: scrollView).y > 0
            }
            .onScroll { scrollView in
                print(scrollView.contentOffset.y)
            }

Modifiers:

with this package you'll have access to these UIScrollView delegate callbacks

    .onScroll { scrollView in }
    .onReachBottom { scrollView in }
    .onReachTop { scrollView in }
    .onEndDecelerating { scrollView in }
    .onEndDragging { scrollView in }

and this UIScrollViewOverride

    .onGestureShouldBegin { panGesture, scrollView -> Bool in }

About

a legacy UIScrollView wrapper for SwiftUI

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 100.0%