{"id":2489,"url":"https://github.com/Guidebook/gbkui-button-progress-view","last_synced_at":"2025-08-03T00:31:43.791Z","repository":{"id":89254070,"uuid":"48065493","full_name":"Guidebook/gbkui-button-progress-view","owner":"Guidebook","description":"Inspired by Apple’s download progress buttons in the app store","archived":false,"fork":false,"pushed_at":"2016-05-26T22:44:40.000Z","size":35,"stargazers_count":541,"open_issues_count":5,"forks_count":41,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-08-16T04:31:20.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Guidebook.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-12-15T19:52:58.000Z","updated_at":"2024-08-02T19:00:59.000Z","dependencies_parsed_at":"2024-01-02T21:24:54.813Z","dependency_job_id":null,"html_url":"https://github.com/Guidebook/gbkui-button-progress-view","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/Guidebook%2Fgbkui-button-progress-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guidebook%2Fgbkui-button-progress-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guidebook%2Fgbkui-button-progress-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guidebook%2Fgbkui-button-progress-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Guidebook","download_url":"https://codeload.github.com/Guidebook/gbkui-button-progress-view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510704,"owners_count":17931751,"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:15.009Z","updated_at":"2024-12-06T18:30:29.773Z","avatar_url":"https://github.com/Guidebook.png","language":"Objective-C","funding_links":[],"categories":["UI"],"sub_categories":["Button","Other free courses"],"readme":"# GBKUIButtonProgressView\nInspired by Apple’s download progress buttons in the app store\n\nCreated by [@pklada](https://twitter.com/pklada) and [@miketsprague](https://twitter.com/miketsprague)\n\n[Checkout the blog post.](http://engineering.guidebook.com/2015/12/15/guidebooks-progress-button-open-sourced/)\n\n![gif](http://petelada.com/images/plada-loading-button.gif)\n\n# Installation\n## Cocoapods\n`pod 'GBKUIButtonProgressView', git: 'https://github.com/Guidebook/gbkui-button-progress-view'`\n\n## Manually add to your project\nJust add the files in `GBKUIButtonProgressView/` to your project\n\n# Usage\n* Create the button as a custom view in your xib, or create it programatically\n* Make sure that you don't have a constraint for its width (it shrinks)--you might need to set the Intrinsic Content Size to \"Placeholder\" in your xib to avoid errors\n\n![intrinsic content size](https://s3.amazonaws.com/f.cl.ly/items/3r3i1I383h1l1f2f3314/Image%202015-12-15%20at%204.48.08%20PM.png?v=aa7b2b4a)\n\n```objc\nself.downloadButton.initialTitle = @\"Download\";\nself.downloadButton.completeTitle = @\"Open\";\n\n// Add a target (like a regular button)\n[self.downloadButton addTarget:self action:@selector(downloadButtonPressed:) forControlEvents:UIControlEventTouchUpInside];\n\n-(void)downloadButtonPressed:(id)sender {\n    // Update the button's state based on your downloading item's state\n    if(!self.isDownloading \u0026\u0026 !self.isDownloaded) {\n        [self.downloadButton startProgressing];\n        [self downloadItem];\n    } else if(self.isDownloaded) {\n        [self openItem];\n    } else {\n        [self cancelDownloadingItem];\n        [self.downloadButton setProgress:0 animated:YES withCompletion:^{\n            [self.downloadButton reset];\n        }];\n    }\n}\n\n-(void)downloadProgressed:(CGFloat)progress {\n  // Update the download button's progress when you get a progress update from your item\n  [self.downloadButton setProgress:progress animated:YES];\n}\n```\n\nTo change the tint color, simply:\n```objc\nself.downloadButton.tintColor = [UIColor redColor];\n```\n\nSee the example for more info.\n\n# Todos\n* Polish the API a bit\n* Allow it to be IBDesignable\n* Inherit from UIControl instead of UIView\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGuidebook%2Fgbkui-button-progress-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGuidebook%2Fgbkui-button-progress-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGuidebook%2Fgbkui-button-progress-view/lists"}