{"id":2276,"url":"https://github.com/fxm90/GradientProgressBar","last_synced_at":"2025-08-06T14:33:06.871Z","repository":{"id":37359345,"uuid":"83881642","full_name":"fxm90/GradientProgressBar","owner":"fxm90","description":"📊 A customizable gradient progress bar (UIProgressView).","archived":false,"fork":false,"pushed_at":"2024-09-06T19:10:33.000Z","size":154949,"stargazers_count":535,"open_issues_count":1,"forks_count":39,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-30T06:25:53.939Z","etag":null,"topics":["cocoapods","gradient","ios","swift","uiprogressview"],"latest_commit_sha":null,"homepage":"https://github.com/fxm90/GradientProgressBar","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/fxm90.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-04T09:17:35.000Z","updated_at":"2024-11-08T14:10:01.000Z","dependencies_parsed_at":"2024-11-16T05:01:36.951Z","dependency_job_id":"5496ce91-45e1-48b0-9fac-de9d844ab53b","html_url":"https://github.com/fxm90/GradientProgressBar","commit_stats":{"total_commits":341,"total_committers":4,"mean_commits":85.25,"dds":0.5219941348973607,"last_synced_commit":"19871af9f6ae2bebd1d125c4faa0d1e5e9a561d5"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fxm90%2FGradientProgressBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fxm90%2FGradientProgressBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fxm90%2FGradientProgressBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fxm90%2FGradientProgressBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fxm90","download_url":"https://codeload.github.com/fxm90/GradientProgressBar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228571857,"owners_count":17938773,"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":["cocoapods","gradient","ios","swift","uiprogressview"],"created_at":"2024-01-05T20:16:09.587Z","updated_at":"2024-12-09T15:30:50.649Z","avatar_url":"https://github.com/fxm90.png","language":"Swift","readme":"GradientProgressBar\n====================\n\n![Swift5.0](https://img.shields.io/badge/Swift-5.0-green.svg?style=flat) ![CI Status](https://img.shields.io/github/workflow/status/fxm90/GradientProgressBar/Continuous%20Integration) ![Code Coverage](https://img.shields.io/codecov/c/github/fxm90/GradientProgressBar.svg?style=flat) ![Version](https://img.shields.io/cocoapods/v/GradientProgressBar.svg?style=flat) ![License](https://img.shields.io/cocoapods/l/GradientProgressBar.svg?style=flat) ![Platform](https://img.shields.io/cocoapods/p/GradientProgressBar.svg?style=flat)\n\nA customizable gradient progress bar (UIProgressView). Inspired by [iOS 7 Progress Bar from Codepen](https://codepen.io/marcobiedermann/pen/LExXWW).\n\n### Example\n![Example][example]\n\nTo run the example project, clone the repo, and open the workspace from the Example directory.\n\n### Requirements\n- Swift 5.5\n- Xcode 13\n- iOS 13.0+\n\n**Note:** In case you need support for iOS versions lower than 13, you can fallback to version `2.X.X`.\n\n### Integration\n##### CocoaPods\n[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate GradientProgressBar into your Xcode project using CocoaPods, specify it in your `Podfile`:\n```ruby\npod 'GradientProgressBar', '~\u003e 3.0'\n```\n\n\n##### Carthage\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate GradientProgressBar into your Xcode project using Carthage, specify it in your `Cartfile`:\n```ogdl\ngithub \"fxm90/GradientProgressBar\" ~\u003e 3.0\n```\nRun carthage update to build the framework and drag the built `GradientProgressBar.framework` into your Xcode project.\n\n\n##### Swift Package Manager\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but Gradient Progress Bar does support its use on supported platforms.\n\nOnce you have your Swift package set up, adding Gradient Progress Bar as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/fxm90/GradientProgressBar\", from: \"3.0.0\")\n]\n```\n\n\n### How to use (`UIKit`)\n*[Scroll down](#how-to-use-swiftui) for the SwiftUI documentation.*\n\nSimply drop a `UIView` into your View Controller in the Storyboard. Select your view and in the `Identity Inspector` change the class to `GradientProgressBar`.\n\u003eDon't forget to change the module to `GradientProgressBar` too.\n\n![Interface Builder][interface-builder]\n\nSetup the constraints for the `UIView` according to your needs.\n\nImport `GradientProgressBar` in your view controller source file.\n```swift\nimport GradientProgressBar\n```\nCreate an `IBOutlet` of the progress view in your view controller source file.\n```swift\n@IBOutlet weak var gradientProgressView: GradientProgressBar!\n```\nAfter that you can set the progress programmatically as you would do on a normal UIProgressView.\n```swift\ngradientProgressView.setProgress(0.75, animated: true)\n```\n```swift\ngradientProgressView.progress = 0.75\n```\n\n\n### Configuration\n#### – Property `animationDuration`\nAdjusts the animation duration for calls to `setProgress(_:animated:)`:\n```swift\nprogressView.animationDuration = 2.0\nprogressView.setProgress(progress, animated: true)\n```\n\n#### – Property `gradientColors`\nAdjusts the colors, used for the gradient inside the progress-view.\n```swift\nprogressView.gradientColors: [UIColor] = [\n    .red,\n    .white,\n    .blue\n]\n```\n\n\n#### – Property `timingFunction`\nAdjusts the timing function for calls to `setProgress(_:animated:)`, with animated set to `true`.\n```swift\nprogressView.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)\n```\n\n\n### Troubleshooting\n#### Interface Builder Support\nUnfortunately the Interface Builder support is currently broken for Cocoapods frameworks. If you need Interface Builder support, add the following code to your Podfile and run `pod install` again. Afterwards you should be able to use the `GradientProgressBar` inside the Interface Builder :)\n```\n  post_install do |installer|\n    installer.pods_project.build_configurations.each do |config|\n      next unless config.name == 'Debug'\n\n      config.build_settings['LD_RUNPATH_SEARCH_PATHS'] = [\n        '$(FRAMEWORK_SEARCH_PATHS)'\n      ]\n    end\n  end\n  ```\nSource: [Cocoapods – Issue 7606](https://github.com/CocoaPods/CocoaPods/issues/7606#issuecomment-484294739)\n\n\n### Show progress of `WKWebView`\nBased on [my gist](https://gist.github.com/fxm90/50d6c73d07c4d9755981b9bb4c5ab931), the example application also contains the sample code, for attaching the progress view to a `UINavigationBar`. Using \"Key-Value Observing\" we change the progress of the bar accordingly to the property `estimatedProgress` of the `WKWebView`.\n\nPlease have a look at the example application for further details :)\n\n\n### How to use (`SwiftUI`)\n*[Scroll up](#how-to-use-uikit) for the UIKit documentation.*\n\nSince version 2.1.0 this framework provides a [`ProgressViewStyle`](https://developer.apple.com/documentation/swiftui/progressviewstyle) that can be used in SwiftUI.\n\n```swift\nstruct ExampleView: View {\n\n    @State\n    private var progress = 0.5\n    \n    var body: some View {\n        ProgressView(value: progress, total: 1)\n            .progressViewStyle(.gradientProgressBar)\n            .frame(height: 4)\n    }\n}\n```\n\n### Configuration\n\n```swift\nstruct ExampleView: View {\n\n    @State\n    private var progress = 0.5\n    \n    var body: some View {\n        ProgressView(value: progress, total: 1)\n            .progressViewStyle(\n                .gradientProgressBar(\n                    backgroundColor: .gray.opacity(0.05),\n                    gradientColors: [.red, .white, .blue],\n                    cornerRadius: 4)\n                )\n             .frame(height: 8)\n    }\n}\n```\n\n\n#### – Parameter `backgroundColor`\nThe background-color shown behind the gradient (clipped by a possible `cornerRadius`).\n\n#### – Parameter `gradientColors`\nThe colors used for the gradient.\n\n#### – Parameter `cornerRadius`\nThe corner-radius used on the background and the progress bar.\n\n### Add / Adapt animation\nTo add an animation you have to wrap the update of the `@State` property inside [`withAnimation(_:_:)`](https://developer.apple.com/documentation/swiftui/withanimation(_:_:)/).\n\n```swift\nButton(\"Animate progress\") {\n    withAnimation(.easeInOut) {\n        progress += 0.1\n    }\n}\n```\n\nPlease have a look at the [Apple documentation for `Animation`](https://developer.apple.com/documentation/swiftui/animation) on how to further customise the animation.\n\n### Author\nFelix Mau (me(@)felix.hamburg)\n\n### License\nGradientProgressBar is available under the MIT license. See the LICENSE file for more info.\n\n[example]: Assets/example.png\n[interface-builder]: Assets/interface-builder.png\n","funding_links":[],"categories":["UI","Libs","Swift","UI [🔝](#readme)","OOM-Leaks-Crash"],"sub_categories":["Activity Indicator","UI","Other free courses","WebView-ProgressBar"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffxm90%2FGradientProgressBar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffxm90%2FGradientProgressBar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffxm90%2FGradientProgressBar/lists"}