{"id":2504,"url":"https://github.com/thePsguy/ButtonProgressBar-iOS","last_synced_at":"2025-08-03T00:31:54.092Z","repository":{"id":47531286,"uuid":"88084468","full_name":"thePsguy/ButtonProgressBar-iOS","owner":"thePsguy","description":"A small and flexible (well documented)  UIButton subclass with animated loading progress, and completion animation.","archived":false,"fork":false,"pushed_at":"2021-08-25T05:20:41.000Z","size":1295,"stargazers_count":574,"open_issues_count":3,"forks_count":48,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-24T14:48:58.128Z","etag":null,"topics":["animated","download","loading","progress","subclass","uibutton"],"latest_commit_sha":null,"homepage":"https://cocoapods.org/pods/ButtonProgressBar-iOS","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/thePsguy.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":"2017-04-12T18:36:52.000Z","updated_at":"2024-04-07T08:42:28.000Z","dependencies_parsed_at":"2022-09-23T13:39:43.491Z","dependency_job_id":null,"html_url":"https://github.com/thePsguy/ButtonProgressBar-iOS","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thePsguy%2FButtonProgressBar-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thePsguy%2FButtonProgressBar-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thePsguy%2FButtonProgressBar-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thePsguy%2FButtonProgressBar-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thePsguy","download_url":"https://codeload.github.com/thePsguy/ButtonProgressBar-iOS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510712,"owners_count":17931754,"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":["animated","download","loading","progress","subclass","uibutton"],"created_at":"2024-01-05T20:16:15.378Z","updated_at":"2024-12-06T18:30:31.425Z","avatar_url":"https://github.com/thePsguy.png","language":"Swift","funding_links":[],"categories":["UI","Content"],"sub_categories":["Button","Other free courses"],"readme":"# ButtonProgressBar-iOS\n\n[![Version](https://img.shields.io/cocoapods/v/ButtonProgressBar-iOS.svg?style=flat)](http://cocoapods.org/pods/ButtonProgressBar-iOS)\n[![License](https://img.shields.io/cocoapods/l/ButtonProgressBar-iOS.svg?style=flat)](http://cocoapods.org/pods/ButtonProgressBar-iOS)\n[![Platform](https://img.shields.io/cocoapods/p/ButtonProgressBar-iOS.svg?style=flat)](http://cocoapods.org/pods/ButtonProgressBar-iOS)\n[![Contact](https://img.shields.io/badge/contact-%40thePsguy-3a8fc1.svg)](https://twitter.com/thePsguy)\n\n\u003cimg src=\"https://raw.githubusercontent.com/thePsguy/ButtonProgressBar-iOS/master/output_F2Ryon.gif\" alt=\"GIF Preview\"/\u003e\n\n## Example\n\n* For LIVE PREVIEW on Appetize in your browser itself, [click here](https://appetize.io/app/rcb15cyg78agt90pqa3xujx3cc).\n\n* To run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n\u003cimg src=\"https://raw.githubusercontent.com/thePsguy/ButtonProgressBar-iOS/master/SimulatorScreenShot.png\" alt=\"Simulator Screen\" width=\"200\"/\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"https://raw.githubusercontent.com/thePsguy/ButtonProgressBar-iOS/master/preview.gif\" alt=\"GIF Preview\" width=\"350\"/\u003e \n\n## Requirements\niOS \u003e 7.0\n\n## Installation\n\nButtonProgressBar-iOS is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'ButtonProgressBar-iOS'\n```\n\n## Usage\n```Swift\nimport ButtonProgressBar_iOS\n```\n\u003chr\u003e\n\n#### Initialize just like you would any other UIButton:\n```swift\nvar progressButton = ButtonProgressBar(frame: CGRect)\nview.addSubview(progressButton)\n```\n\u003chr\u003e\n\n#### Since this is a UIButton subclass, targets and labels can be set in the same way:\n```swift\nprogressButton.addTarget(nil, action: #selector(self.tapped), for: .touchUpInside)\nprogressButton.setTitle(\"Download\", for: .normal)\n```\n\u003chr\u003e\n\n#### The completion image can be set with;\n_This image must be set since no default exists._\n```swift    \n  setCompletionImage(image: UIImage)\n```\n\u003chr\u003e\n\n#### Indeterminate loading can be handled with the following functions:\n```swift\nstartIndeterminate(withTimePeriod time: TimeInterval)\nstartIndeterminate(withTimePeriod time: TimeInterval, andTimePadding padding: TimeInterval)\n\n/*\nTime Padding is the duration (default 0.5), in seconds, before starting the next cycle.\nTime Period is the total time (animation + padding) that 1 cycle of the loading takes.\n*/\n\nstopIndeterminate()  //Stops the indeterminate loading.\n```\n\u003chr\u003e\n\n#### For determinate usage or otherwise, progress can be set with:\n```swift\nsetProgress(progress: CGFloat, _ animated: Bool) \n/*\nProgress ranges from 0.0 to 1.0\n\nIf animated is true, linearly animates to progress.\n*/\n\nresetProgress()  //Set progress to 0.0 unanimated.\n```\n\u003chr\u003e\n\n#### Set the progress and background colors:\n```swift\nsetBackgroundColor(color: UIColor)\nsetProgressColor(color: UIColor)\n```\n\u003chr\u003e\n\n#### To explicitly show/hide the title / image:\n```swift\nhideTitle(_ hidden: Bool)\nhideImage(_ hidden: Bool)\n```\n\u003chr\u003e\n\n#### Stop indeterminate loading if active, set progress to 1.0 animated, and display completion image if set.\n     Needs to be called explicitly when loading determinate as well.\n```swift\n  triggerCompletion()\n```\n\u003chr\u003e\n\n## Author\n\nPushkar Sharma, thePsguy@icloud.com\n\u003chr\u003e\n\nInspiration from [Dribbble](https://dribbble.com/shots/2551579-Download-Button)\n\n[Android version](https://github.com/ishaan1995/ButtonProgressBar) available!\n\n\n## License\n\nButtonProgressBar-iOS is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FthePsguy%2FButtonProgressBar-iOS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FthePsguy%2FButtonProgressBar-iOS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FthePsguy%2FButtonProgressBar-iOS/lists"}