gh123man / SwiftUI-Refresher

A native, customizable SwiftUI refresh control
MIT License
129 stars 12 forks source link

Added an option to trigger the refresh action upon releasing the finger #16

Closed Econa77 closed 1 year ago

Econa77 commented 1 year ago

The default behavior is for the refresh action to be triggered when the scroll reaches a threshold. However, with customized SpinnerView, as shown in this video, continuous scrolling can result in a user experience where refreshing can occur too easily and consecutively.

So, I've introduced an option to defer the action determination until after releasing the finger. this option may deviate from the standard UIKit behavior, and I would like to leave the decision of incorporating it into the library to your discretion. If you find it unnecessary, please feel free to close it

gh123man commented 1 year ago

Hi @Econa77, Thanks for the PR.

I agree this is not an ideal behavior as is. In fact, I'd consider it a bug and want to change the default behavior to not allow a new refresh until the user lifts their finger.

Personally, I don't think we need a config option for this - let me know if this is a requirement for you. I made a quick prototype fix here: https://github.com/gh123man/SwiftUI-Refresher/compare/lockOnFingerDown

Could you give that branch a try and let me know if it works how you expect? If so i'll merge it, if not feel free to either let me know, or update this PR accordingly.

Econa77 commented 1 year ago

@gh123man Thanks. I've tried the branch, and I also believe the behavior of this branch is correct.

Please close this PR after merging the branch 👍

gh123man commented 1 year ago

Thanks for confirming! Closed in favor of https://github.com/gh123man/SwiftUI-Refresher/pull/17