{"id":22015892,"url":"https://github.com/pircate/easyrefresher","last_synced_at":"2025-05-07T01:05:37.051Z","repository":{"id":54826665,"uuid":"185343308","full_name":"Pircate/EasyRefresher","owner":"Pircate","description":"The refresh control associated with the scroll view.","archived":false,"fork":false,"pushed_at":"2021-01-27T03:09:41.000Z","size":11233,"stargazers_count":16,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T01:05:08.034Z","etag":null,"topics":["refresh","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/Pircate.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":"2019-05-07T07:13:09.000Z","updated_at":"2024-06-06T21:57:57.000Z","dependencies_parsed_at":"2022-08-14T04:00:57.115Z","dependency_job_id":null,"html_url":"https://github.com/Pircate/EasyRefresher","commit_stats":null,"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pircate%2FEasyRefresher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pircate%2FEasyRefresher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pircate%2FEasyRefresher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pircate%2FEasyRefresher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pircate","download_url":"https://codeload.github.com/Pircate/EasyRefresher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252793667,"owners_count":21805058,"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":["refresh","swift"],"created_at":"2024-11-30T04:29:50.716Z","updated_at":"2025-05-07T01:05:37.002Z","avatar_url":"https://github.com/Pircate.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EasyRefresher\n\n[![CI Status](https://img.shields.io/travis/Pircate/EasyRefresher.svg?style=flat)](https://travis-ci.org/Pircate/EasyRefresher)\n[![Version](https://img.shields.io/cocoapods/v/EasyRefresher.svg?style=flat)](https://cocoapods.org/pods/EasyRefresher)\n[![License](https://img.shields.io/cocoapods/l/EasyRefresher.svg?style=flat)](https://cocoapods.org/pods/EasyRefresher)\n[![Platform](https://img.shields.io/cocoapods/p/EasyRefresher.svg?style=flat)](https://cocoapods.org/pods/EasyRefresher)\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\n* iOS 10.0\n* Swift 5.0\n\n## Installation\n\nEasyRefresher is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'EasyRefresher'\n```\n\n## Preview\n\n![](https://github.com/Pircate/EasyRefresher/blob/master/image.gif)\n![](https://github.com/Pircate/EasyRefresher/blob/master/image1.gif)\n\n## Usage\n\n* Add Refresher\n\n```swift\ntableView.refresh.header.addRefreshClosure {\n    self.reqeust {\n        self.tableView.refresh.header.endRefreshing()\n    }\n}\n\ntableView.refresh.footer = AutoRefreshFooter(triggerMode: .percent(0.5)) {\n    self.reqeust {\n        self.tableView.refresh.footer.endRefreshing()\n    }\n}\n\ntableView.refresh.header = RefreshHeader(delegate: self)\n\n```\n\n* Manual Trigger\n\n```swift\ntableView.refresh.header.beginRefreshing()\n```\n\n* State Title\n\n```swift\ntableView.refresh.header.setTitle(\"loading...\", for: .refreshing)\n\ntableView.refresh.footer.setAttributedTitle(\n    NSAttributedString(string: \"已到最后一页\", attributes: [.foregroundColor: UIColor.red]), for: .disabled\n)\n```\n\n* Last updated time\n\n```swift\ntableView.refresh.header.lastUpdatedTimeText = { date in\n    guard let date = date else { return \"暂无更新记录\" }\n    \n    return \"上次刷新时间：\\(date)\"\n}\n\n```\n\n* UIActivityIndicatorView Style\n\n```swift\ntableView.refresh.header.activityIndicatorStyle = .white\n```\n\n* Disabled\n\n```swift\n// End refreshing and set state to disabled\ntableView.refresh.footer.isEnabled = false\n```\n\n* Remove\n\n```swift\ntableView.refresh.footer.removeFromScrollView()\n```\n\n* Impact feedback\n\n```swift\ntableView.refresh.header.impactFeedbackMode = .on(style: .medium)\n```\n\n* Custom State View\n\n```swift\nextension CustomStateView: RefreshStateful {\n    \n    public func refresher(_ refresher: Refresher, didChangeState state: RefreshState) {\n    \n    }\n    \n    public func refresher(_ refresher: Refresher, didChangeOffset offset: CGFloat) {\n    \n    }\n}\n\ntableView.refresh.footer = AppearanceRefreshFooter(stateView: CustomStateView()) {\n    self.reqeust {\n        self.tableView.refresh.footer.endRefreshing()\n    }\n}\n```\n\n## Author\n\nPircate, swifter.dev@gmail.com\n\n## License\n\nEasyRefresher is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpircate%2Feasyrefresher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpircate%2Feasyrefresher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpircate%2Feasyrefresher/lists"}