apptekstudios / ASCollectionView

A SwiftUI collection view with support for custom layouts, preloading, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TableView Pull To Refresh not working

Harout360 opened this issue · comments

Describe the bug
I'm unable to enable pullToRefresh for tableviews. Even the Instafeed demo that uses pull to refresh doesn't actually pull to refresh. See the following code from the demo:

ASTableView(sections: sections)
            .tableViewSeparatorsEnabled(false)
            .tableViewOnPullToRefresh { endRefreshing in
                print("PULL TO REFRESH")
                Timer.scheduledTimer(withTimeInterval: 2, repeats: false) { _ in
                    endRefreshing()
                }
        }
        ....

Looking into ASTableView, it seems like func configureRefreshControl(for tv: UITableView) isn't being called anywhere?

To Reproduce
Launch demo, go to instafeed, try pull to refresh

Expected behaviour
tableViewOnPullToRefresh enables pull to refresh

Screenshots
If applicable, add screenshots to help explain your problem.

Xcode Version:

  • 11.3

Simulator, Device, Both?

  • Simulator

PR for the fix
#102

Thankyou for the issue and PR fix! 😄 Merged, and will include in the next release