{"id":2703,"url":"https://github.com/gontovnik/DGElasticPullToRefresh","last_synced_at":"2025-08-06T16:31:56.316Z","repository":{"id":37359585,"uuid":"44432672","full_name":"gontovnik/DGElasticPullToRefresh","owner":"gontovnik","description":"Elastic pull to refresh for iOS developed in Swift","archived":false,"fork":false,"pushed_at":"2022-06-01T08:10:13.000Z","size":3810,"stargazers_count":3771,"open_issues_count":59,"forks_count":440,"subscribers_count":67,"default_branch":"master","last_synced_at":"2025-07-22T23:52:20.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://medium.com/@gontovnik/elastic-view-animation-or-how-i-built-dgelasticpulltorefresh-269a3ba8636e#.9dioekqv6","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/gontovnik.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":"2015-10-17T10:20:50.000Z","updated_at":"2025-07-01T07:38:04.000Z","dependencies_parsed_at":"2022-07-16T23:16:20.486Z","dependency_job_id":null,"html_url":"https://github.com/gontovnik/DGElasticPullToRefresh","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/gontovnik/DGElasticPullToRefresh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gontovnik%2FDGElasticPullToRefresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gontovnik%2FDGElasticPullToRefresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gontovnik%2FDGElasticPullToRefresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gontovnik%2FDGElasticPullToRefresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gontovnik","download_url":"https://codeload.github.com/gontovnik/DGElasticPullToRefresh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gontovnik%2FDGElasticPullToRefresh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269112576,"owners_count":24362000,"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","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-01-05T20:16:20.595Z","updated_at":"2025-08-06T16:31:55.763Z","avatar_url":"https://github.com/gontovnik.png","language":"Swift","readme":"# DGElasticPullToRefresh\nElastic pull to refresh compontent developed in Swift\n\nInspired by this Dribbble post: [Pull Down to Refresh](https://dribbble.com/shots/2232385-Pull-Down-to-Refresh) by [Hoang Nguyen](https://dribbble.com/Hoanguyen)\n\nTutorial on how this bounce effect was achieved can be found [here](https://medium.com/@gontovnik/elastic-view-animation-or-how-i-built-dgelasticpulltorefresh-269a3ba8636e#.9dioekqv6).\n\n![](https://raw.githubusercontent.com/gontovnik/DGElasticPullToRefresh/master/DGElasticPullToRefreshPreview1.gif)\n![](https://raw.githubusercontent.com/gontovnik/DGElasticPullToRefresh/master/DGElasticPullToRefreshPreview2.gif)\n\n## Requirements\n* Xcode 7 or higher\n* iOS 8.0 or higher (may work on previous versions, just did not test it)\n* ARC\n* Swift 3.0\n\n## Demo\n\nOpen and run the DGElasticPullToRefreshExample project in Xcode to see DGElasticPullToRefresh in action.\n\n## Installation\n\n### CocoaPods\n\n``` ruby\npod 'DGElasticPullToRefresh'\n```\n\n### Manual\n\nAdd DGElasticPullToRefresh folder into your project.\n\n## Example usage\n\n``` swift\n// Initialize tableView\nlet loadingView = DGElasticPullToRefreshLoadingViewCircle()\nloadingView.tintColor = UIColor(red: 78/255.0, green: 221/255.0, blue: 200/255.0, alpha: 1.0)\ntableView.dg_addPullToRefreshWithActionHandler({ [weak self] () -\u003e Void in\n    // Add your logic here\n    // Do not forget to call dg_stopLoading() at the end\n    self?.tableView.dg_stopLoading()\n}, loadingView: loadingView)\ntableView.dg_setPullToRefreshFillColor(UIColor(red: 57/255.0, green: 67/255.0, blue: 89/255.0, alpha: 1.0))\ntableView.dg_setPullToRefreshBackgroundColor(tableView.backgroundColor!)\n```\n\nDo not forget to remove pull to refresh on view controller deinit. It is a temporary solution.\n\n``` swift\ndeinit {\n    tableView.dg_removePullToRefresh()\n}\n```\n\n### Description\n\nAdd pull to refresh without loading view:\n\n``` swift\nfunc dg_addPullToRefreshWithActionHandler(_ actionHandler: @escaping () -\u003e Void)\n```\n\nAdd pull to refresh with loading view:\n\n``` swift\nfunc dg_addPullToRefreshWithActionHandler(_ actionHandler: @escaping () -\u003e Void, loadingView: DGElasticPullToRefreshLoadingView?)\n```\n\nYou can use built-in *DGElasticPullToRefreshLoadingViewCircle* or create your own by subclassing **DGElasticPullToRefreshLoadingView** and implementing these methods:\n\n``` swift\nfunc setPullProgress(_ progress: CGFloat)\nfunc startAnimating()\nfunc stopLoading()\n```\n\nRemove pull to refresh:\n\n``` swift\nfunc dg_removePullToRefresh()\n```\n\nSet auto start loading:\n\n``` swift\nfunc dg_startLoading()\n```\n\nChange pull to refresh background color:\n\n``` swift\nfunc dg_setPullToRefreshBackgroundColor(_ color: UIColor)\n```\n\nChange pull to refresh fill color:\n\n``` swift\nfunc dg_setPullToRefreshFillColor(_ color: UIColor)\n```\n\n## Contribution\n\nPlease feel free to submit pull requests. Cannot wait to see your custom loading views for this pull to refresh.\n\n## Contact\n\nDanil Gontovnik\n\n- https://github.com/gontovnik\n- https://twitter.com/gontovnik\n- http://gontovnik.com/\n- danil@gontovnik.com\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Danil Gontovnik\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","funding_links":[],"categories":["UI","Libs","ALL","UI Components","Swift","UI [🔝](#readme)"],"sub_categories":["Pull to Refresh","UI","Layout","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgontovnik%2FDGElasticPullToRefresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgontovnik%2FDGElasticPullToRefresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgontovnik%2FDGElasticPullToRefresh/lists"}