Skip to content

0.2.0

Latest
Compare
Choose a tag to compare
@c-villain c-villain released this 20 Dec 18:01
· 3 commits to main since this release
2e62fe4

Add ScrollDistance to control responsiveness for refreshable during scrolling

import Refreshable

struct Constants {
    public static let isPad: Bool = UIDevice.current.userInterfaceIdiom == .pad
}

struct YourView: View {
    
    var body: some View {
        ScrollView {
            RefreshControl(Constants.isPad ? .long : .short, // <= HERE
                           coordinateSpace: .named("List")) { 
                // do your work on refresh here
            }
            
            LazyVStack {
                ...
            }
        }
        .coordinateSpace(name: "List")
    }
}