https://github.com/Sylvia-YiyinShen/PulldownRefreshDemo
There are several different ways to implement pull-down refresh. One is based on scrollView delegate functions, another one is based on key-value observing on contentOffset. My demo is implemented via the later approach, since when applying the pull-down refreshing to a tableVIew it just requires 2-line changes.
- Easy to configure refresh control on existing tableView/collectionView
- Easy to replace the indicator(1-line change if using the indicator provided within the demo) https://github.com/Sylvia-YiyinShen/LoadingIndicatorDemo
How to use
- Grab Indicator and PulldownRefresh folder to your project
- Make your tableView subclassing RefreshableTableView
- Invoke RefreshableTableView func configureRefreshControl(refreshHandler: @escaping () -> Void)
- Invoke in the right place RefreshableTableView func refreshDone()
No comments:
Post a Comment