{"id":2709,"url":"https://github.com/coolbeet/CBStoreHouseRefreshControl","last_synced_at":"2025-08-03T00:32:22.206Z","repository":{"id":22829204,"uuid":"26176273","full_name":"coolbeet/CBStoreHouseRefreshControl","owner":"coolbeet","description":"Fully customizable pull-to-refresh control inspired by Storehouse iOS app","archived":false,"fork":false,"pushed_at":"2020-01-02T18:18:11.000Z","size":1368,"stargazers_count":3926,"open_issues_count":27,"forks_count":481,"subscribers_count":127,"default_branch":"master","last_synced_at":"2024-04-24T14:51:18.402Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/coolbeet.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-11-04T15:57:38.000Z","updated_at":"2024-04-20T17:43:19.000Z","dependencies_parsed_at":"2022-08-17T17:00:30.804Z","dependency_job_id":null,"html_url":"https://github.com/coolbeet/CBStoreHouseRefreshControl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coolbeet%2FCBStoreHouseRefreshControl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coolbeet%2FCBStoreHouseRefreshControl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coolbeet%2FCBStoreHouseRefreshControl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coolbeet%2FCBStoreHouseRefreshControl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coolbeet","download_url":"https://codeload.github.com/coolbeet/CBStoreHouseRefreshControl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510777,"owners_count":17931761,"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":[],"created_at":"2024-01-05T20:16:20.771Z","updated_at":"2024-12-06T18:30:42.001Z","avatar_url":"https://github.com/coolbeet.png","language":"Objective-C","readme":"CBStoreHouseRefreshControl ![License MIT](https://go-shields.herokuapp.com/license-MIT-blue.png)\n=======================\n\n![Version](http://cocoapod-badges.herokuapp.com/v/CBStoreHouseRefreshControl/badge.png)\n![Platform](http://cocoapod-badges.herokuapp.com/p/CBStoreHouseRefreshControl/badge.png)\n\nWhat is it?\n---\n\nA **fully customizable** pull-to-refresh control for iOS inspired by [Storehouse](https://www.storehouse.co/) iOS app\n\n![screenshot1] (https://s3.amazonaws.com/suyu.test/CBStoreHouseRefreshControl1.gif)\n\nYou can use any shape through a `plist` file, like this one:\n\n![screenshot2] (https://s3.amazonaws.com/suyu.test/CBStoreHouseRefreshControl2.gif)\n\nWhich files are needed?\n---\nCBStoreHouseRefreshControl is available through [CocoaPods](http://cocoapods.org), to install\nit simply add the following line to your Podfile:\n\n    pod 'CBStoreHouseRefreshControl'\n\nAlternatively, you can just drag `CBStoreHouseRefreshControl (.h .m)` and `BarItem (.h .m)` into your own project.\n\nHow to use it\n---\nYou can attach it to any `UIScrollView` like `UITableView` or `UICollectionView` using following simple static method:\n\n```objective-c\n+ (CBStoreHouseRefreshControl*)attachToScrollView:(UIScrollView *)scrollView\n                                           target:(id)target\n                                    refreshAction:(SEL)refreshAction\n                                            plist:(NSString *)plist;\n```\n```objective-c\nself.storeHouseRefreshControl = [CBStoreHouseRefreshControl attachToScrollView:self.tableView target:self refreshAction:@selector(refreshTriggered:) plist:@\"storehouse\"];\n```\nOr, using this method for more configurable options:\n\n```objective-c\n+ (CBStoreHouseRefreshControl*)attachToScrollView:(UIScrollView *)scrollView\n                                           target:(id)target\n                                    refreshAction:(SEL)refreshAction\n                                            plist:(NSString *)plist\n                                            color:(UIColor *)color\n                                        lineWidth:(CGFloat)lineWidth\n                                       dropHeight:(CGFloat)dropHeight\n                                            scale:(CGFloat)scale\n                             horizontalRandomness:(CGFloat)horizontalRandomness\n                          reverseLoadingAnimation:(BOOL)reverseLoadingAnimation\n                          internalAnimationFactor:(CGFloat)internalAnimationFactor;\n```\n\n```objective-c\nself.storeHouseRefreshControl = [CBStoreHouseRefreshControl attachToScrollView:self.tableView target:self refreshAction:@selector(refreshTriggered:) plist:@\"storehouse\" color:[UIColor whiteColor] lineWidth:1.5 dropHeight:80 scale:1 horizontalRandomness:150 reverseLoadingAnimation:YES internalAnimationFactor:0.5];\n```\n\nThen, implement `UIScrollViewDelegate` in your `UIViewController` if you haven't already, and pass the calls through to the refresh control:\n\n```objective-c\n- (void)scrollViewDidScroll:(UIScrollView *)scrollView\n{\n    [self.storeHouseRefreshControl scrollViewDidScroll];\n}\n\n- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate\n{\n    [self.storeHouseRefreshControl scrollViewDidEndDragging];\n}\n```\n\nLastly, make sure you've implemented the `refreshAction` you passed it earlier to listen for refresh triggers:\n\n```objective-c\n- (void)refreshTriggered\n{\n    //call your loading method here\n\n    //Finshed loading the data, reset the refresh control\n    [self.storeHouseRefreshControl finishingLoading];\n}\n```\nFor more details, please check out the demo app's code.\n\nHow to use your own shape\n---\n\nThe CBStoreHouseRefreshControl's shape contains bunch of `BarItem` for animation, each `BarItem` is running its own animation, you need to provide `startPoint` and `endPoint` through a plist file. \n\nAll `BarItem` will share one coordinate system whose origin is at the top-left corner. For example if you want to draw a square, the plist will look like this:\n\n![screenshot2] (https://s3.amazonaws.com/suyu.test/square.png)\n\nThe result will look like this:\n\n![screenshot3] (https://s3.amazonaws.com/suyu.test/square.gif)\n\n#### Notes: \n- Make sure you put the right key which are `startPoints` and `endPoints`.\n- Make sure you are using the right format (`{x,y}`) for coordinates.\n- The highlight/loading animation will highlight each bar item in the same order you declare them in plist, use `reverseLoadingAnimation` to reverse the animation.\n\nEasy way to generate `startPoint` and `endPoint`?\n---\n\n[@isaced](https://github.com/isaced) mentions that it's easier to use [PaintCode](http://www.paintcodeapp.com/) to generate `startPoint` and `endPoint`:\n\n![screenshot4] (https://cloud.githubusercontent.com/assets/2088605/4948694/0ce2da74-667f-11e4-8ce7-a2067f15558d.png)\n\nResult:\n\n![screenshot5] (https://cloud.githubusercontent.com/assets/2088605/4948707/3b76afb4-667f-11e4-91a4-9509d17356fa.gif)\n\nYou can get more info [here](https://github.com/coolbeet/CBStoreHouseRefreshControl/issues/1).\n\nConfiguration\n-------------\n\nPlay with following parameters to configure CBStoreHouseRefreshControl's view and animation:\n\n- Set the bar color with the `color` parameter\n- Set the bar width with the `lineWidth` parameter\n- Set the height of control with the `dropHeight` parameter\n- Set the scale of control with the `scale` parameter\n- Adjust how disperse the bar items appear/disappear by changing the `horizontalRandomness` parameter\n- Set if reversing the loading animation with the `reverseLoadingAnimation` parameter, if set to `YES`, the last bar item will be highlighted firstly.\n- Adjust the time offset of the appear/disappear animation by changing the `internalAnimationFactor` parameter, for example if `internalAnimationFactor` is 1 all bar items will appear/disappear all together.\n\nWho's using it?\n---------------\n\nWe've a [wiki page](https://github.com/coolbeet/CBStoreHouseRefreshControl/wiki) for that, feel free to add your projects there!\n\nAuthor\n------\n\nSuyu Zhang  \nsuyu_zhang@hotmail.com  \n[suyuzhang.com](http://suyuzhang.com/)  \n\n\nLicense\n-------\nCopyright (c) 2014 Suyu Zhang \u003csuyu_zhang@hotmail.com\u003e. See the LICENSE file for license rights and limitations (MIT).\n\n\n\n\n","funding_links":[],"categories":["UI","PullToRefresh","Objective-C","**Index**","Uncategorized","ALL"],"sub_categories":["Pull to Refresh","Recently I've done a few projects that involve Payments, iBeacons, and PassKit. Make sure to check these links out:","Layout","Other free courses","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoolbeet%2FCBStoreHouseRefreshControl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoolbeet%2FCBStoreHouseRefreshControl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoolbeet%2FCBStoreHouseRefreshControl/lists"}