{"id":13610307,"url":"https://github.com/PavelKatunin/DownloadButton","last_synced_at":"2025-04-12T22:33:18.878Z","repository":{"id":33043923,"uuid":"36679800","full_name":"PavelKatunin/DownloadButton","owner":"PavelKatunin","description":"Customizable App Store style download button","archived":false,"fork":false,"pushed_at":"2020-12-02T17:18:32.000Z","size":664,"stargazers_count":1524,"open_issues_count":15,"forks_count":183,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-04-03T07:18:22.744Z","etag":null,"topics":["button","buttons","cocoapod","customizable","downloadbutton","ios","ios-animation","uikit"],"latest_commit_sha":null,"homepage":"http://pavelkatunin.github.io/DownloadButton","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PavelKatunin.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-06-01T18:23:58.000Z","updated_at":"2025-03-25T07:36:17.000Z","dependencies_parsed_at":"2022-06-27T04:21:25.241Z","dependency_job_id":null,"html_url":"https://github.com/PavelKatunin/DownloadButton","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/PavelKatunin%2FDownloadButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelKatunin%2FDownloadButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelKatunin%2FDownloadButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PavelKatunin%2FDownloadButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PavelKatunin","download_url":"https://codeload.github.com/PavelKatunin/DownloadButton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248641743,"owners_count":21138258,"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":["button","buttons","cocoapod","customizable","downloadbutton","ios","ios-animation","uikit"],"created_at":"2024-08-01T19:01:43.446Z","updated_at":"2025-04-12T22:33:18.246Z","avatar_url":"https://github.com/PavelKatunin.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"# DownloadButton\n\n[![CI Status](http://img.shields.io/travis/Pavel Katunin/DownloadButton.svg?style=flat)](https://travis-ci.org/Pavel Katunin/DownloadButton)\n[![Version](https://img.shields.io/cocoapods/v/DownloadButton.svg?style=flat)](http://cocoapods.org/pods/DownloadButton)\n[![License](https://img.shields.io/cocoapods/l/DownloadButton.svg?style=flat)](http://cocoapods.org/pods/DownloadButton)\n[![Platform](https://img.shields.io/cocoapods/p/DownloadButton.svg?style=flat)](http://cocoapods.org/pods/DownloadButton)\n\nCustomizable appstore style download button.\n\n![Default button animation](https://cloud.githubusercontent.com/assets/1636737/7921348/7fadc250-08ad-11e5-9f01-9f7e1f173a97.gif)\n\n![Default button](https://cloud.githubusercontent.com/assets/1636737/7920830/2c4470da-08aa-11e5-99be-e7e9a04479f8.png)\n\nCustomizable designable components. Editing with IB.\n\n![Custom button animation](https://cloud.githubusercontent.com/assets/1636737/7921396/ec8b21c4-08ad-11e5-99a4-c73c971c0d42.gif)\n\n![Custom button](https://cloud.githubusercontent.com/assets/1636737/7920909/7403d906-08aa-11e5-92d5-f92a09bc2bdc.png)\n\n![Designable button](https://cloud.githubusercontent.com/assets/1636737/7921499/92a772ba-08ae-11e5-9222-e5bd229de6b2.gif)\n\n\n## Usage\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\nCheck example project to see usage.\n\n```objective-c\n#import \u003cDownloadButton/PKDownloadButton.h\u003e\n```\n\nUsage for representing network operations:\n\n```objective-c\n#pragma mark - PKDownloadButtonDelegate\n\n- (void)downloadButtonTapped:(PKDownloadButton *)downloadButton \n                currentState:(PKDownloadButtonState)state {\n    switch (state) {\n        case kPKDownloadButtonState_StartDownload:\n            self.downloadButton.state = kPKDownloadButtonState_Pending;\n            [self.pendingSimulator startDownload];\n        break;\n        case kPKDownloadButtonState_Pending:\n            [self.pendingSimulator cancelDownload];\n            self.downloadButton.state = kPKDownloadButtonState_StartDownload;\n        break;\n            case kPKDownloadButtonState_Downloading:\n            [self.downloaderSimulator cancelDownload];\n            self.downloadButton.state = kPKDownloadButtonState_StartDownload;\n        break;\n        case kPKDownloadButtonState_Downloaded:\n            self.downloadButton.state = kPKDownloadButtonState_StartDownload;\n            self.imageView.hidden = YES;\n        break;\n        default:\n            NSAssert(NO, @\"unsupported state\");\n        break;\n    }\n}\n\n#pragma mark - DownloaderSimulatorDelegate\n\n- (void)simulator:(PKDownloaderSimulator *)simulator didUpdateProgress:(double)progress {\n    if (simulator == self.pendingSimulator) {\n        if (progress == 1.) {\n            self.downloadButton.state = kPKDownloadButtonState_Downloading;\n            [self.downloaderSimulator startDownload];\n        }\n    }\n    else if (simulator == self.downloaderSimulator) {\n        self.downloadButton.stopDownloadButton.progress = progress;\n        if (progress == 1) {\n            self.downloadButton.state = kPKDownloadButtonState_Downloaded;\n            self.imageView.hidden = NO;\n        }\n    }\n}\n```\n\nAppearance customization:\n\n```objective-c\n\n#import \"UIImage+PKDownloadButton.h\"\n#import \"UIButton+PKDownloadButton.h\"\n\n[self.downloadButton.downloadedButton cleanDefaultAppearance];\n[self.downloadButton.downloadedButton setBackgroundImage:[UIImage buttonBackgroundWithColor:[UIColor redColor]]\nforState:UIControlStateNormal];\n[self.downloadButton.downloadedButton setBackgroundImage:[UIImage highlitedButtonBackgroundWithColor:[UIColor redColor]]\nforState:UIControlStateHighlighted];\n[self.downloadButton.downloadedButton setTitle:@\"delete\" forState:UIControlStateNormal];\n[self.downloadButton.downloadedButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];\n[self.downloadButton.downloadedButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];\n\nself.downloadButton.stopDownloadButton.tintColor = [UIColor blackColor];\nself.downloadButton.stopDownloadButton.filledLineStyleOuter = YES;\n\nself.downloadButton.pendingView.tintColor = [UIColor orangeColor];\nself.downloadButton.pendingView.radius = 24.f;\nself.downloadButton.pendingView.emptyLineRadians = 2.f;\nself.downloadButton.pendingView.spinTime = 3.f;\n\n[self.downloadButton.startDownloadButton cleanDefaultAppearance];\n[self.downloadButton.startDownloadButton setImage:[UIImage imageNamed:@\"download_default\"] forState:UIControlStateNormal];\n\n```\n\n## Requirements\n\nRequires iOS SDK version \u003e 8.0\n\n## Installation\n\nDownloadButton is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"DownloadButton\"\n```\n\n## Author\n\nPavel Katunin, wk.katunin@gmail.com\n\n## License\n\nDownloadButton is available under the Apache License, Version 2.0. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPavelKatunin%2FDownloadButton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPavelKatunin%2FDownloadButton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPavelKatunin%2FDownloadButton/lists"}