{"id":2721,"url":"https://github.com/eggswift/pull-to-refresh","last_synced_at":"2025-05-15T00:09:07.445Z","repository":{"id":37359233,"uuid":"58139380","full_name":"eggswift/pull-to-refresh","owner":"eggswift","description":"#Busy Re-Building....# An easy way to use pull to refresh and infinite scrolling in Swift. Pod 'ESPullToRefresh' ","archived":false,"fork":false,"pushed_at":"2023-09-27T11:01:06.000Z","size":38063,"stargazers_count":1843,"open_issues_count":87,"forks_count":256,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-05-14T16:39:30.079Z","etag":null,"topics":["collectionview","espulltorefresh","infinite-scroll","pull-to-refresh","refresh","refresher","scrollview","swift","swift3","textview","webview"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eggswift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-05T15:04:35.000Z","updated_at":"2025-05-14T05:20:24.000Z","dependencies_parsed_at":"2024-06-18T11:09:41.814Z","dependency_job_id":"f2ee28b2-7033-4d12-bd9e-ce1aab9a87ad","html_url":"https://github.com/eggswift/pull-to-refresh","commit_stats":{"total_commits":124,"total_committers":30,"mean_commits":4.133333333333334,"dds":0.7661290322580645,"last_synced_commit":"6bfa290dcb98e0bb5e43bd9bcf51cafca1640cef"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggswift%2Fpull-to-refresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggswift%2Fpull-to-refresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggswift%2Fpull-to-refresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggswift%2Fpull-to-refresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggswift","download_url":"https://codeload.github.com/eggswift/pull-to-refresh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249206,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collectionview","espulltorefresh","infinite-scroll","pull-to-refresh","refresh","refresher","scrollview","swift","swift3","textview","webview"],"created_at":"2024-01-05T20:16:21.086Z","updated_at":"2025-05-15T00:09:02.436Z","avatar_url":"https://github.com/eggswift.png","language":"Swift","readme":"\n\u003c!-- ![logo](logo.png) --\u003e\n\n[![Travis](https://travis-ci.org/eggswift/pull-to-refresh.svg?branch=master)](https://travis-ci.org/eggswift/pull-to-refresh)\n[![CocoaPods](https://img.shields.io/cocoapods/v/ESPullToRefresh.svg)](http://cocoapods.org/pods/pull-to-refresh)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Swift v3](https://img.shields.io/badge/Swift-v3-orange.svg?style=flat)](https://developer.apple.com/swift/)\n[![Twitter](https://img.shields.io/badge/Twitter-@lihao_iOS-blue.svg?style=flat)](https://twitter.com/lihao_iOS)\n[![Twitter](https://img.shields.io/badge/Weibo-@李昊_____-orange.svg?style=flat)](http://weibo.com/5120522686/profile?rightmod=1\u0026wvr=6\u0026mod=personinfo\u0026is_all=1)\n\n### [中文介绍](README_CN.md)\n\n**ESPullToRefresh** is an easy-to-use component that give **pull-to-refresh** and **infinite-scrolling** implemention for developers. By extension to UIScrollView, you can easily add pull-to-refresh and infinite-scrolling for any subclass of UIScrollView. If you want to customize its UI style, you just need conform the specified protocol.\n\n\n## Requirements\n\n* Xcode 8 or later\n* iOS 8.0 or later\n* ARC\n* Swift 5.0 or later\n\n## Features\n\n* Support `UIScrollView` and its subclasses `UICollectionView` `UITableView` `UITextView`\n* Pull-Down to refresh and Pull-Up to load more\n* Support customize your own style(s)\n\n## Demo\n\nDownload and run the ESPullToRefreshExample project in Xcode to see ESPullToRefresh in action.\n\n\n## Installation\n\n### CocoaPods\n\n``` ruby\npod \"ESPullToRefresh\"\n```\n\n### Carthage\n\n```ruby\ngithub \"eggswift/pull-to-refresh\"\n```\n\n### Manually\n\n``` ruby\ngit clone https://github.com/eggswift/pull-to-refresh.git\nopen ESPullToRefresh\n```\n\n## Usage\n\n### Default style:\n\n\n![](example_default.gif)\n\n\n\nAdd `ESPullToRefresh` to your project\n\n```swift\nimport ESPullToRefresh\n```\n\nAdd default pull-to-refresh\n\n``` swift\nself.tableView.es.addPullToRefresh {\n\t[unowned self] in\n\t/// Do anything you want...\n\t/// ...\n\t/// Stop refresh when your job finished, it will reset refresh footer if completion is true\n\tself.tableView.es.stopPullToRefresh(completion: true)\n\t/// Set ignore footer or not\n\tself.tableView.es.stopPullToRefresh(completion: true, ignoreFooter: false)\n}\n```\n\nAdd default infinite-scrolling\n``` swift\nself.tableView.es.addInfiniteScrolling {\n\t[unowned self] in\n\t/// Do anything you want...\n\t/// ...\n\t/// If common end\n\tself.tableView.es.stopLoadingMore()\n\t/// If no more data\n\tself.tableView.es.noticeNoMoreData()\n}\n```\n\n\n### Customize Style\n\n#### As effect:\n\n![](example_meituan.gif)\n\n**PS: Load effect is from MeiTuan iOS app.**\n\n![](example_wechat.gif)\n\n\nCustomize refresh need conform the **ESRefreshProtocol** and **ESRefreshAnimatorProtocol** protocol.\n\nAdd customize pull-to-refresh\n\n``` swift\nfunc es.addPullToRefresh(animator animator: protocol\u003cESRefreshProtocol, ESRefreshAnimatorProtocol\u003e, handler: ESRefreshHandler)\n```\n\nAdd customize infinite-scrolling\n\n``` swift\nfunc es.addInfiniteScrolling(animator animator: protocol\u003cESRefreshProtocol, ESRefreshAnimatorProtocol\u003e, handler: ESRefreshHandler)\n```\n\n### Espried and auto refresh\n\nESPullToRefresh support for the latest expiration time and the cache refresh time, You need set an `refreshIdentifier` to your UIScrollView.\n``` swift\nscrollView.refreshIdentifier = \"Your Identifier\" // Set refresh identifier\nscrollView.expriedTimeInterval = 20.0 // Set the expiration interval\n```\nYou can use `es.autoPullToRefresh()` method, when the time over the last refresh interval expires automatically refreshed.\n``` swift\nscrollView.es.autoPullToRefresh()\n\nlet expried = scrollView.espried // expired or not\n```\n\n\n### Remove\n\n``` swift\nfunc es.removeRefreshHeader()\nfunc es.removeRefreshFooter()\n```\n\n\n## Sponsor\n\nYou can support the project by checking out our sponsor page. It takes only one click:\n\n\u003ca href='https://tracking.gitads.io/?repo=pull-to-refresh'\u003e\u003cimg src=\"https://images.gitads.io/pull-to-refresh\" alt=\"git-ad\"/\u003e\u003c/a\u003e\n\u003cbr\u003e\u003ci\u003eThis advert was placed by \u003ca href=\"https://tracking.gitads.io/?campaign=gitads\u0026repo=pull-to-refresh\u0026redirect=gitads.io\"\u003eGitAds\u003c/a\u003e \u003c/i\u003e\n\n\n## About\n\nESPullToRefresh is developed and maintained by [Vincent Li](mailto:lihao_iOS@hotmail.com). If you have any questions or issues in using ESPullToRefresh, welcome to [issue](https://github.com/eggswift/pull-to-refresh/issues). \u003c/br\u003e\nIf you want to contribute to ESPullToRefresh, Please submit [Pull Request](https://github.com/eggswift/pull-to-refresh/pulls), I will deal with it as soon as possible. \u003c/br\u003e\n\n[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=https://github.com/eggswift/pull-to-refresh)\n[![Twitter Follow](https://img.shields.io/twitter/follow/lihao_ios.svg?style=social)](https://twitter.com/lihao_iOS)\n\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013-2020 eggswift\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n","funding_links":[],"categories":["UI"],"sub_categories":["Pull to Refresh","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggswift%2Fpull-to-refresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggswift%2Fpull-to-refresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggswift%2Fpull-to-refresh/lists"}