{"id":13995655,"url":"https://github.com/WXGBridgeQ/SwiftPullToRefresh","last_synced_at":"2025-07-22T22:31:47.690Z","repository":{"id":20397442,"uuid":"89827889","full_name":"WXGBridgeQ/SwiftPullToRefresh","owner":"WXGBridgeQ","description":"An easy way to implement pull-to-refresh feature based on UIScrollView extension, written in Swift 4.","archived":false,"fork":false,"pushed_at":"2024-02-19T13:56:24.000Z","size":3304,"stargazers_count":465,"open_issues_count":16,"forks_count":55,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-30T10:46:41.460Z","etag":null,"topics":["pull-to-refresh","scrollview-compatible","swift"],"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/WXGBridgeQ.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":"2017-04-30T03:51:09.000Z","updated_at":"2024-08-29T11:27:30.000Z","dependencies_parsed_at":"2024-06-18T18:27:24.117Z","dependency_job_id":"726d17f3-a3d4-46fe-ac03-241d2242347a","html_url":"https://github.com/WXGBridgeQ/SwiftPullToRefresh","commit_stats":{"total_commits":103,"total_committers":7,"mean_commits":"14.714285714285714","dds":"0.15533980582524276","last_synced_commit":"58129766a998664c0039bc5f74eea0c1c7f954e6"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WXGBridgeQ%2FSwiftPullToRefresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WXGBridgeQ%2FSwiftPullToRefresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WXGBridgeQ%2FSwiftPullToRefresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WXGBridgeQ%2FSwiftPullToRefresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WXGBridgeQ","download_url":"https://codeload.github.com/WXGBridgeQ/SwiftPullToRefresh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227190271,"owners_count":17745238,"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":["pull-to-refresh","scrollview-compatible","swift"],"created_at":"2024-08-09T14:03:32.038Z","updated_at":"2024-11-29T18:30:47.530Z","avatar_url":"https://github.com/WXGBridgeQ.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"![Logo](logo.png)\n\n[![Build Status](https://travis-ci.org/WXGBridgeQ/SwiftPullToRefresh.svg)](https://travis-ci.org/WXGBridgeQ/SwiftPullToRefresh)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg)](https://github.com/Carthage/Carthage)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/SwiftPullToRefresh.svg)](https://cocoapods.org/pods/SwiftPullToRefresh)\n[![Platform](https://img.shields.io/cocoapods/p/SwiftPullToRefresh.svg)](https://cocoapods.org/pods/SwiftPullToRefresh)\n[![Language](https://img.shields.io/badge/language-swift-orange.svg)](https://swift.org/)\n[![License](https://img.shields.io/badge/license-MIT-000000.svg)](https://github.com/WXGBridgeQ/SwiftPullToRefresh/blob/master/LICENSE)\n[![codebeat badge](https://codebeat.co/badges/05eca7f9-68b2-4ca1-aa72-abe7edc5aff2)](https://codebeat.co/projects/github-com-wxgbridgeq-swiftpulltorefresh-master)\n\n# SwiftPullToRefresh\n\nAn easy way to implement pull-to-refresh feature based on UIScrollView extension, written in Swift 4.\n\nProvide default style header and footer controls which you can directly use in your project, and also support for customization. GIF is also supported.\n\n## Example usage\n\n#### Indicator Header\n\n```swift\nscrollView.spr_setIndicatorHeader { [weak self] in\n    // do your action here\n    // self?.scrollView.spr_endRefreshing()\n}\n```\n\n![](SwiftPullToRefreshDemo/demo01.gif)\n\n#### Text Header\n\n```swift\nscrollView.spr_setTextHeader { [weak self] in\n    // do your action here\n    // self?.scrollView.spr_endRefreshing()\n}\n```\n\n![](SwiftPullToRefreshDemo/demo02.gif)\n\n#### Small GIF Header\n\n```swift\nscrollView.spr_setGIFHeader(data: data, isBig: false, height: 60) { [weak self] in\n    // do your action here\n    // self?.scrollView.spr_endRefreshing()\n}\n```\n\n![](SwiftPullToRefreshDemo/demo03.gif)\n\n#### GIF + Text Header\n\n```swift\nscrollView.spr_setGIFTextHeader(data: data) { [weak self] in\n    // do your action here\n    // self?.scrollView.spr_endRefreshing()\n}\n```\n\n![](SwiftPullToRefreshDemo/demo04.gif)\n\n#### Big GIF Header\n\n```swift\nscrollView.spr_setGIFHeader(data: data, isBig: true, height: 120) { [weak self] in\n    // do your action here\n    // self?.scrollView.spr_endRefreshing()\n}\n```\n\n![](SwiftPullToRefreshDemo/demo05.gif)\n\n#### Indicator Footer\n\n```swift\nscrollView.spr_setIndicatorFooter { [weak self] in\n    // do your action here\n    // self?.scrollView.spr_endRefreshing()\n}\n```\n\nor\n\n```swift\nscrollView.spr_setIndicatorAutoFooter { [weak self] in\n    // do your action here\n    // self?.scrollView.spr_endRefreshing()\n}\n```\n\n![](SwiftPullToRefreshDemo/demo07.gif)\n\n#### Text Footer\n\n```swift\nscrollView.spr_setTextFooter { [weak self] in\n    // do your action here\n    // self?.scrollView.spr_endRefreshing()\n}\n```\n\nor\n\n```swift\nscrollView.spr_setTextAutoFooter { [weak self] in\n    // do your action here\n    // self?.scrollView.spr_endRefreshing()\n}\n```\n\n![](SwiftPullToRefreshDemo/demo08.gif)\n\n#### Clear header or footer\n\n```swift\nscrollView.spr_clearHeader()\nscrollView.spr_clearFooter()\n```\n\n## Demo\n\nOpen and run the SwiftPullToRefreshDemo target in Xcode to see SwiftPullToRefresh in more actions.\n\n## Requirements\n\n* iOS 8.0\n* Swift 4.0\n\n## Installation\n\n#### CocoaPods\n\n```\nuse_frameworks!\npod 'SwiftPullToRefresh'\n```\n\n#### Carthage\n\n```\ngithub \"WXGBridgeQ/SwiftPullToRefresh\"\n```\n\n#### Manual\n\nAdd SwiftPullToRefresh folder into your project.\n\n## Customization\n\nThe framework is very easy to customize the use.\n\nYou just need to subclass the `RefreshView` and implement the methods below, then call `spr_setCustomHeader(_:)` or `spr_setCustomFooter(_:)` with your scrollView.\n\n```swift\nclass CustomHeaderOrFooter: RefreshView {\n    override func didUpdateState(_ isRefreshing: Bool) {\n        // customize your view display with refresh state here\n    }\n    \n    override func didUpdateProgress(_ progress: CGFloat) {\n        // customize your view display with progress here\n    }\n}\n```\n\nYou can also check the code of the super cat refresh which is a custom header in the SwiftPullToRefreshDemo target (Inspired by [RayWenderlich](https://videos.raywenderlich.com/courses/68-scroll-view-school/lessons/18))\n\n![](SwiftPullToRefreshDemo/demo06.gif)\n\n## Contribution\n\nYou are welcome to contribute to the project by forking the repo, modifying the code and opening issues or pull requests.\n\n## License\n\nAvailable under MIT license. See the [LICENSE](https://github.com/WXGBridgeQ/SwiftPullToRefresh/blob/master/LICENSE) for more info.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWXGBridgeQ%2FSwiftPullToRefresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWXGBridgeQ%2FSwiftPullToRefresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWXGBridgeQ%2FSwiftPullToRefresh/lists"}