{"id":20841427,"url":"https://github.com/pakej/progressbarkit","last_synced_at":"2025-05-08T22:10:41.466Z","repository":{"id":62451145,"uuid":"169715959","full_name":"pakej/ProgressBarKit","owner":"pakej","description":"An animatable and customizable progress bar that can be used as a single or multiple bars.","archived":false,"fork":false,"pushed_at":"2019-12-13T14:00:29.000Z","size":664,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-04-18T04:02:00.287Z","etag":null,"topics":["animatable","cocoapod","instagram","progress-bar","segmented","stories"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pakej.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-08T10:09:01.000Z","updated_at":"2019-12-13T14:00:27.000Z","dependencies_parsed_at":"2022-11-01T23:33:05.686Z","dependency_job_id":null,"html_url":"https://github.com/pakej/ProgressBarKit","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakej%2FProgressBarKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakej%2FProgressBarKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakej%2FProgressBarKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakej%2FProgressBarKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pakej","download_url":"https://codeload.github.com/pakej/ProgressBarKit/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253154975,"owners_count":21862622,"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":["animatable","cocoapod","instagram","progress-bar","segmented","stories"],"created_at":"2024-11-18T01:20:02.365Z","updated_at":"2025-05-08T22:10:41.401Z","avatar_url":"https://github.com/pakej.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProgressBarKit\n![pod-version](https://img.shields.io/cocoapods/v/ProgressBarKit) ![pod-platform](https://img.shields.io/cocoapods/p/ProgressBarKit)\n\nAn animatable progress bar that can easily be used to display progress.\n\n## Requirements\n\n- Swift 4.2\n- iOS 10 or later\n\n## Installation\n\n### Cocoapods\n\nAdd the following to your `Podfile`:\n```\npod 'ProgressBarKit'\n```\n\n## Documentation\n\nFor a full deep-dive, refer to the [full documentation](https://pakej.github.io/ProgressBarKit/).\n\n## Usage\n\nIt's very easy to start using the progress bar. Simply:\n\n1. Import and initialize\n1. Setup\n1. Set progress value\n\nBut... i need more customization. Sure, go straight [here](#advanced-usage)!\n\n### Import and Initialize\n\n```swift\nimport ProgressBarKit\n\nclass ViewController: UIViewController {\n    lazy var progressBar: ProgressBar = {\n        ProgressBar(trackColour: [.black], barColour: [.purple])\n    }()\n}\n```\n\n### Intial Setup\n\nSpecify the `UIView` that will be the progress bar's container view and initializes the progress bar in it.\n\n```swift\nprogressBar.setup(in: myContainerView)\n```\n\n\u003csub\u003eImportant:\nThis method should only be called ONCE, and only in `viewDidLayoutSubviews` to ensure the `container` has already been laid out correctly by AutoLayout.\u003c/sub\u003e\n\n### Set Progress Value\n\nAnimates the progress bar from `0` until the given percentage value (in decimal number) of the total width of the progress bar container view.\n\nie. Given, `value = 0.75` and `containerView.frame.width` is `100`\nThe progress bar will only be expanded until a width of `0.75 * 100` which is 75 points.\n\n```swift\nprogressBar.setProgressBarValue(to: 0.75)\n```\n\n\u003csub\u003eNote:\nThis method should only be called after calling `setupProgressBar(in:)` to ensure the progress bar is already initialized.\u003c/sub\u003e\n\n## Advanced Usage\n\nSo your _designer_ put or _you_ wanted a little bit more challenge to your design. Fret not, ProgressBarKit _mostly_ got you covered!\n\n### 1 progress bar with default BAR and TRACK configuration\n\n ```swift\n let bar = ProgressBar(trackColour: [.black], barColour: [.purple])\n ```\n\n### 1 progress bar with custom BAR configuration\n\n ```swift\n let barConfig = PBBarConfiguration(\n     roundingCorners: [.allCorners],\n     cornerRadii: CGSize(width: 8, height: 8)\n )\n\n let bar = ProgressBar(trackColour: [.black], barColour: [.purple], configurations: [.bar: barConfig])\n ```\n\n### 1 progress bar with custom TRACK configurations\n\n ```swift\n let trackConfig = PBTrackConfiguration(\n     roundingCorners: [.allCorners],\n     cornerRadii: CGSize(width: 8, height: 8),\n     edgeInsets: UIEdgeInsets(top: 2.5, left: 2.5, bottom: 2.5, right: 2.5)\n )\n\n let bar = ProgressBar(trackColour: [.black], barColour: [.purple], configurations: [.track: [trackConfig]])\n ```\n\n### 2 or more progress bars with default and custom TRACK configurations\n\n ```swift\n let firstTrackConfig = PBTrackConfiguration(\n     roundingCorners: [.topLeft, .bottomLeft],\n     cornerRadii: CGSize(width: 8, height: 8),\n     edgeInsets: UIEdgeInsets(top: 2.5, left: 2.5, bottom: 2.5, right: 2.5)\n )\n\n let lastTrackConfig = PBTrackConfiguration(\n     roundingCorners: [.topRight, .bottomRight],\n     cornerRadii: CGSize(width: 8, height: 8),\n     edgeInsets: UIEdgeInsets(top: 2.5, left: 2.5, bottom: 2.5, right: 2.5)\n )\n\n // use default values\n let otherTrackConfig = PBTrackConfiguration()\n\n // this will display 3 tracks with different configurations, and\n // you can have some fun here by adding more configs into the array, and\n // watch the magic happens!\n let configs = [firstTrackConfig, otherTrackConfig, lastTrackConfig]\n let bar = ProgressBar(trackColour: [.black], barColour: [.purple], configurations: [.track: configs])\n ```\n\n ### 2 or more progress bars with GRADIENT track and bars\n\n ```swift\n // use default values\n let defaultTrackConfig = PBTrackConfiguration()\n\n // this will display the track and bar in gradient colours\n // you can have some fun here by adding more colours into the array, and\n // watch the gradient colour changes!\n let gradientTrackColours: [UIColor] = [.black, .white]\n let gradientBarColours: [UIColor] = [.red, .purple]\n\n let configs = [defaultTrackConfig, defaultTrackConfig, defaultTrackConfig]\n let bar = ProgressBar(trackColour: gradientTrackColours, barColour: gradientBarColours, configurations: [.track: configs])\n ```\n\n## Contributing\nWe'd love to accept your patches and contributions to this project! Checkout [contributing](CONTRIBUTING.md) and [code of conduct](CODE_OF_CONDUCT.md) to learn more.\n\n## License\nSee LICENSE file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpakej%2Fprogressbarkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpakej%2Fprogressbarkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpakej%2Fprogressbarkit/lists"}