New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instead of callback, can I use a @State to control refresh action? #11
Comments
Hi, the library is completely agnostic in terms of how you handle your refreshing, which also includes how you cancel it. In other words, something like this would work: RefreshableScrollView(onRefresh: { done in
isLoading = true
DispatchQueue(label: "background").async {
while isLoading { }
done()
}
}, As far as triggering the refresh action by setting |
@gordan-glavas-codecons |
It's just a block you can pass it around any way you want. You can even store it in a state var: @State private var refreshBlock: RefreshComplete? = nil
...
RefreshableScrollView(onRefresh: { done in
refreshBlock = done
}
// call refreshBlock?() elsewhere |
@gordan-glavas-codecons |
Hi, thank you for your great implementation.
How could I achieve things like using @State var loading = false to control when the refreshing action should be finish.
Thanks
The text was updated successfully, but these errors were encountered: