{"id":13995886,"url":"https://github.com/jcavar/refresher","last_synced_at":"2025-04-12T18:48:48.852Z","repository":{"id":20125203,"uuid":"23395167","full_name":"jcavar/refresher","owner":"jcavar","description":"DEPRECATED: Pull to refresh in Swift","archived":false,"fork":false,"pushed_at":"2019-08-24T17:55:25.000Z","size":1178,"stargazers_count":873,"open_issues_count":11,"forks_count":99,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-10-11T06:08:58.006Z","etag":null,"topics":["pull-to-refresh","swift","xcode"],"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/jcavar.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":"2014-08-27T15:35:09.000Z","updated_at":"2024-04-19T08:16:21.000Z","dependencies_parsed_at":"2022-08-03T15:10:22.502Z","dependency_job_id":null,"html_url":"https://github.com/jcavar/refresher","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcavar%2Frefresher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcavar%2Frefresher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcavar%2Frefresher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcavar%2Frefresher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcavar","download_url":"https://codeload.github.com/jcavar/refresher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618214,"owners_count":21134199,"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","swift","xcode"],"created_at":"2024-08-09T14:03:38.459Z","updated_at":"2025-04-12T18:48:48.791Z","avatar_url":"https://github.com/jcavar.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"## DEPRECATED\nThis library is no longer maintained.\nI am not using it in any of my projects, and I, unfortunately, don't have time to maintain it in my free time.\nPlease [open an issue](https://github.com/jcavar/refresher/issues/new) if you are willing to become the new maintainer.\n\n\u003cimg src=\"https://raw.githubusercontent.com/jcavar/refresher/master/refresher.png\" width=\"250\" /\u003e\n\n[![Build Status](https://travis-ci.org/jcavar/refresher.svg)](https://travis-ci.org/jcavar/refresher)\n \nRefresher is pull to refresh library written in Swift. It provides easy to use UIScrollView methods to add pull to refresh to your view. \nRefresher also supports custom animations.\n\n## Usage\n\n### Basic usage\n\n```swift\ntableView.addPullToRefreshWithAction {\n\tNSOperationQueue().addOperationWithBlock {\n    \tsleep(2)\n        NSOperationQueue.mainQueue().addOperationWithBlock {\n        \tself.tableView.stopPullToRefresh()\n        }\n    }\n}\n```\n\n### Custom animations\n\nRefresher supports custom animations on `PullToRefreshView`. You need to create object that conforms to `PullToRefreshViewAnimator` protocol.\nThen, just pass your custom animator in `addPullToRefrshWithAction`:\n\n```swift\ntableView.addPullToRefreshWithAction({           \n  \tNSOperationQueue().addOperationWithBlock {\n   \t\tsleep(2)\n        NSOperationQueue.mainQueue().addOperationWithBlock {\n        \tself.tableView.stopPullToRefresh()\n        }\n    }\n}, withAnimator: CustomAnimator())\n```\n\nRequired methods that your custom object need to implement are:\n\n*   `func pullToRefreshAnimationDidStart(view: PullToRefreshView)`- Called when user releases finger and when loading actually starts. Start your animations here.\n*   `func pullToRefreshAnimationDidEnd(view: PullToRefreshView)` - Called when animation is over. Perform any necessary after animation cleanup here.\n*   `func pullToRefresh(view: PullToRefreshView, progressDidChange progress: CGFloat)` - Called while user is pulling scroll view. Useful if you want to implement some kind of progress like behaviour.\n*   `func pullToRefresh(view: PullToRefreshView, stateDidChange state: PullToRefreshViewState)` - Called when `PullToRefreshView` changes its state  \n\n\n### Custom views\n\nYou can use your own custom `UIView` subclass as pull to refresh view.\n\n```swift\n\nif let customSubview = NSBundle.mainBundle().loadNibNamed(\"CustomSubview\", owner: self, options: nil).first as? CustomSubview {\n\ttableView.addPullToRefreshWithAction({\n\t\tNSOperationQueue().addOperationWithBlock {\n\t\t\tsleep(2)\n\t\t\tNSOperationQueue.mainQueue().addOperationWithBlock {\n\t\t\t\tself.tableView.stopPullToRefresh()\n\t\t\t}\n\t\t}\n\t}, withAnimator: customSubview)\n}\n```\n\nYour custom subclass has to conform to `PullToRefreshViewDelegate`.\n\n## Requirements\n\n*\tXcode 6\n*\tiOS 8.0\n\n## Installation\n\n### Git submodule\n\n1.\tAdd Refresher as a git submodule into your top-level project directory or simply copy whole folder\n2.\tFind `PullToRefresh.xcodeproj` and drag it into the file navigator of your app project.\n3.\tIn Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the \"Targets\" heading in the sidebar.\n4.\tUnder \"General\" panel go to \"Linked Frameworks and Libraries\" and add `Refresher.framework`\n\n### Framework\n\n1.\tSimply download Refresher\n2.\tBuild it and you should find `Refresher.framework` under \"Products\" group.\n3.\tRight click on it and select \"Show in Finder\" option.\n4.\tJust drag and drop `Refresher.framework` to your project\n\n### Cocoapods\n\n1.\tAdd `pod 'Refresher'` to your Podfile\n2.\tRun `pod install`\n\n## Examples\n\n![Refresher: preview default](https://raw.githubusercontent.com/jcavar/refresher/master/previews/anim_default.gif)\n![Refresher: preview beat](https://raw.githubusercontent.com/jcavar/refresher/master/previews/anim_beat.gif)\n![Refresher: preview pacman](https://raw.githubusercontent.com/jcavar/refresher/master/previews/anim_pacman.gif)\n\n## Credits\n\nRefresher is created by [Josip Ćavar](https://twitter.com/josip04) and inspired by [SVPullToRefresh](https://github.com/samvermette/SVPullToRefresh/). If you have suggestions or bug reports, feel free to send pull request or [create new issue](https://github.com/jcavar/refresher/issues/new).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcavar%2Frefresher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcavar%2Frefresher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcavar%2Frefresher/lists"}