GithubHelp home page GithubHelp logo

fatbobman / isscrolling Goto Github PK

View Code? Open in Web Editor NEW
67.0 1.0 3.0 67 KB

As the name suggests, IsScrolling provides a ViewModifier to get the current scrolling state of a ScrollView or List in SwiftUI. IsScrolling has good backward and forward compatibility since it is fully implemented natively in SwiftUI. 正如名称所示,IsScrolling 提供了一个 ViewModifier ,用来获取 SwiftUI 中 ScrollView 或 List 当前的滚动状态。由于完全采用了 SwiftUI 原生的方式实现此功能,因此 IsScrolling 具备了很好的前后兼容性。

Home Page: https://www.fatbobman.com

License: MIT License

Swift 100.00%
swift swiftui

isscrolling's Issues

Request Feature

Is posible recive encapsulate resposte, with ScrollStatus enum, for receive more info of scroll states

enum ScrollState {
    case idle
    case upScrolling
    case downScrolling

    func isScrolling() -> Bool {
        return self == .upScrolling || self == .downScrolling
    }
}

Possible to get scroll callbacks?

This solution works great.
I am just wondering is it possible to have callbacks in the form of completion handlers? If so, how?

I want to pass those completion handlers to another View so that certain actions can be performed.

For reference:

ScrollView(axes, showsIndicators: showIndicators) {
            ZStack {
                ScrollStatusMonitor(onScrollingStarted: {
                    onScrollingStarted()
                }, onScrollingFinished: {
                    onScrollingFinished()
                })
                self.content
            }
        }

Thanks very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.