{"id":2722,"url":"https://github.com/CRAnimation/CRRefresh","last_synced_at":"2025-08-03T00:32:29.749Z","repository":{"id":44839800,"uuid":"84775852","full_name":"CRAnimation/CRRefresh","owner":"CRAnimation","description":"An easy way to use pull-to-refresh","archived":false,"fork":false,"pushed_at":"2021-01-15T10:07:47.000Z","size":1522,"stargazers_count":966,"open_issues_count":28,"forks_count":105,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-04-24T14:51:31.776Z","etag":null,"topics":["animation","effects","pull-to-refresh"],"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/CRAnimation.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}},"created_at":"2017-03-13T02:31:07.000Z","updated_at":"2024-04-20T06:03:50.000Z","dependencies_parsed_at":"2022-08-12T11:40:13.704Z","dependency_job_id":null,"html_url":"https://github.com/CRAnimation/CRRefresh","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CRAnimation%2FCRRefresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CRAnimation%2FCRRefresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CRAnimation%2FCRRefresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CRAnimation%2FCRRefresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CRAnimation","download_url":"https://codeload.github.com/CRAnimation/CRRefresh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510787,"owners_count":17931765,"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":["animation","effects","pull-to-refresh"],"created_at":"2024-01-05T20:16:21.110Z","updated_at":"2024-12-06T18:30:44.723Z","avatar_url":"https://github.com/CRAnimation.png","language":"Swift","funding_links":[],"categories":["UI"],"sub_categories":["Pull to Refresh","Other free courses"],"readme":"[![Version](https://img.shields.io/cocoapods/v/CRRefresh.svg?style=flat)](http://cocoapods.org/pods/CRRefresh)\n[![License](https://img.shields.io/cocoapods/l/CRRefresh.svg?style=flat)](http://cocoapods.org/pods/CRRefresh)\n[![Platform](https://img.shields.io/cocoapods/p/CRRefresh.svg?style=flat)](http://cocoapods.org/pods/CRRefresh)\n[![Support](https://img.shields.io/badge/support-iOS%208%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/) \n![Language](https://img.shields.io/badge/Language-%20swift%20%20-blue.svg)\n\n![](CRRefresh.png)\n\n**CRRefresh** an easy way to use pull-to-refresh, If you want to customize its UI style, you just need conform the specified protocol. We will not regularly updated some nice dynamic effect, at the same time also welcome to write to me ~ \n\n[中文介绍](README_CN.md) / [博客介绍](http://blog.csdn.net/wang631106979/article/details/62888435)\n\n## Screenshots\n\n| ![](CRRefresh1.gif) |  ![](CRRefresh2.gif)   | ![](CRRefresh3.gif) |\n| :-----------------: | :--------------------: | :-----------------: |\n|  `NormalAnimator`   | `SlackLoadingAnimator` | `RamotionAnimator`  |\n| ![](CRRefresh4.gif) |                        |                     |\n|   `FastAnimator`    |                        |                     |\n\n## Requirements\n\n- Xcode 8 or later\n- iOS 8.0 or later\n- ARC\n- Swift 3.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## Installation\n\n### CocoaPods\n\nCocoaPods is the recommended way to add CRRefresh to your project.\n\nAdd a pod entry for CRRefresh to your Podfile.\n\n```ruby\npod 'CRRefresh'\n```\n\nSecond, install CRRefresh into your project:\n\n```ruby\npod install\n```\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate `CRRefresh` into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```\ngithub \"CRAnimation/CRRefresh\"\n```\n\nRun `carthage update` to build the framework and drag the built `CRRefresh.framework` (in Carthage/Build/iOS folder) into your Xcode project (Linked Frameworks and Libraries in `Targets`).\n\n### Manually\n\n1. Download the latest code version .\n2. Open your project in Xcode,drag the `CRRefresh` folder into your project. Make sure to select Copy items when asked if you extracted the code archive outside of your project.\n3. You need it with `import CRRefresh `.\n\n## Usage\n\n![](CRRefresh3.gif)\n\n**Add `CRRefresh` to your project**\n\n```swift\nimport CRRefresh\n```\n\n**Add pull-to-refresh**\n\n```swift\n/// animator: your customize animator, default is NormalHeaderAnimator\ntableView.cr.addHeadRefresh(animator: NormalHeaderAnimator()) { [weak self] in\n    /// start refresh\n    /// Do anything you want...\n    DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: {\n        /// Stop refresh when your job finished, it will reset refresh footer if completion is true\n        self?.tableView.cr.endHeaderRefresh()\n    })\n}\n/// manual refresh\ntableView.cr.beginHeaderRefresh()\n```\n\n**Add infinite-scrolling**\n\n```swift\n/// animator: your customize animator, default is NormalFootAnimator\ntableView.cr.addFootRefresh(animator: NormalFootAnimator()) { [weak self] in\n    /// start refresh\n    /// Do anything you want...\n    DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: {\n        /// If common end\n        self?.tableView.cr.endLoadingMore()\n        /// If no more data\n        self?.tableView.cr.noticeNoMoreData()\n\t\t/// Reset no more data\n\t\tself?.tableView.cr.resetNoMore()\n    })\n}\n```\n\n## Customize Style\n\nCustomize refresh need conform the **CRRefreshProtocol**  protocol.\n\n```swift\npublic protocol CRRefreshProtocol {\n    /// Customize view\n    var view: UIView {get}\n    \n    /// View insets\n    var insets: UIEdgeInsets {set get}\n    \n    /// The height of the trigger to refresh\n    var trigger: CGFloat {set get}\n    \n    /// The height of the animation is executed\n    var execute: CGFloat {set get}\n    \n    /// Start refresh\n    mutating func refreshBegin(view: CRRefreshComponent)\n    \n    /// End refresh\n    mutating func refreshEnd(view: CRRefreshComponent, finish: Bool)\n    \n    /// Refresh the progress changes\n    mutating func refresh(view: CRRefreshComponent, progressDidChange progress: CGFloat)\n    \n    /// Refresh the state changes\n    mutating func refresh(view: CRRefreshComponent, stateDidChange state: CRRefreshState)\n}\n```\n\n## Remove\n\n```swift\ntableView.cr.removeFooter()\ntableView.cr.removeHeader()\n```\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## Contacts\n\nIf you wish to contact me\n\n- Email: wangchonglei93@icloud.com\n- Github: https://github.com/imwcl\n- QQ: 631106979\n- Dynamic effect study group: 547897182\n\n## License\n\nCRRefresh is released under the [MIT license](LICENSE). See LICENSE for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCRAnimation%2FCRRefresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCRAnimation%2FCRRefresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCRAnimation%2FCRRefresh/lists"}