jcavar / refresher

DEPRECATED: Pull to refresh in Swift
MIT License
873 stars 99 forks source link

Recursive loading #1

Closed andriyadi closed 10 years ago

andriyadi commented 10 years ago

I managed to integrate this control to collection view. But somehow due to my special configuration, the refresher keep loading. Meaning, action block keep called.

I managed to fix that by changing PullToRefreshView.swift. I believe on line 132:

                    if (previousOffset < -(self.scrollViewInsetsDefaultValue.top + self.frame.size.height)) {
                        if (scrollView?.dragging == false && loading == false) {
                            loading = true
                        } else if (loading == true) {
                            labelTitle.text = "Loading ..."
                        } else {
                            labelTitle.text = "Release to refresh"
                            animator.changeProgress(-previousOffset / self.frame.size.height)
                        }
                    }

by considering scrollView insets. Please advice if you have better solution.

jcavar commented 10 years ago

Hi, Thank you for reporting this. I modified your solution and wrote tests for this problem. Can you please review changes and test again?

andriyadi commented 10 years ago

Awesome! Your latest commit solves my problem. My initial solution doesn't deal with animation while pulling. So, yours is great!

Thanks!

jcavar commented 10 years ago

Great! Thank you once again. :)