Skip to content
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

Refresh status binding #3

Open
AzSiAz opened this issue Jun 1, 2022 · 2 comments
Open

Refresh status binding #3

AzSiAz opened this issue Jun 1, 2022 · 2 comments

Comments

@AzSiAz
Copy link

AzSiAz commented Jun 1, 2022

Some kind of binding to have a programmatic ability to refresh content or just set view to refresh state

My use case is for when you refresh in subview but navigate back and navigate again to subview but refresh is no longer show
Task is launched in global ObservableObject to avoid stopping or losing progress since it's refreshing a lot of item

@yiweiwoshiniya
Copy link

@gh123man is it possible to add

@gh123man
Copy link
Owner

gh123man commented Sep 2, 2024

Hi, You can currently access the underlying binding state via the refreshView argument.

.refresher(refreshView: { bindingState in
            // access bindingState here
            return DefaultRefreshView(state: bindingState)
        }) {
            ...
        }

However it may not be very ergonomic. You will have to mutate the mode and modeAnimated properties of RefresherState.

Let me know if this works for you. If this isn't enough, can you give a code example of what you are trying to accomplish? I'm happy to add support - but I want to make sure we get the API right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants