All Projects → fxm90 → Gradientprogressbar

fxm90 / Gradientprogressbar

Licence: mit
📊 A customizable gradient progress bar (UIProgressView).

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Gradientprogressbar

Gradients
🌔 A curated collection of splendid 180+ gradients made in swift
Stars: ✭ 719 (+131.19%)
Mutual labels:  cocoapods, gradient
Gradientloadingbar
⌛️A customizable animated gradient loading bar.
Stars: ✭ 569 (+82.96%)
Mutual labels:  cocoapods, gradient
Rhplaceholder
Show pleasant loading view for your users 😍
Stars: ✭ 238 (-23.47%)
Mutual labels:  cocoapods, gradient
Complimentarygradientview
Create complementary gradients generated from dominant and prominent colors in supplied image. Inspired by Grade.js
Stars: ✭ 691 (+122.19%)
Mutual labels:  cocoapods, gradient
Grview
UIView and other UIKit elements with a gradient and other attributes for IOS
Stars: ✭ 39 (-87.46%)
Mutual labels:  cocoapods, gradient
Dtgradientbutton
Easy way to set gradient background to your buttons.
Stars: ✭ 76 (-75.56%)
Mutual labels:  cocoapods, gradient
Skeletonui
☠️ Elegant skeleton loading animation in SwiftUI and Combine
Stars: ✭ 275 (-11.58%)
Mutual labels:  cocoapods, gradient
Anyformatkit
Simple text formatting in Swift
Stars: ✭ 296 (-4.82%)
Mutual labels:  cocoapods
Wordpress Ios
WordPress for iOS - Official repository
Stars: ✭ 3,239 (+941.48%)
Mutual labels:  cocoapods
Attributedstring
基于Swift插值方式优雅的构建富文本, 支持点击长按事件, 支持不同类型过滤, 支持自定义视图等.
Stars: ✭ 294 (-5.47%)
Mutual labels:  cocoapods
Mixpanel Swift
Official iOS (Swift) Tracking Library for Mixpanel Analytics
Stars: ✭ 294 (-5.47%)
Mutual labels:  cocoapods
Co.revely.gradient
An Android library for easy gradient management
Stars: ✭ 298 (-4.18%)
Mutual labels:  gradient
Functionkit
A framework for functional types and operations designed to fit naturally into Swift.
Stars: ✭ 302 (-2.89%)
Mutual labels:  cocoapods
Web3.swift
A pure swift Ethereum Web3 library
Stars: ✭ 295 (-5.14%)
Mutual labels:  cocoapods
Tpinappreceipt
Reading and Validating In App Purchase Receipt Locally.
Stars: ✭ 305 (-1.93%)
Mutual labels:  cocoapods
Netfox
A lightweight, one line setup, iOS / OSX network debugging library! 🦊
Stars: ✭ 3,188 (+925.08%)
Mutual labels:  cocoapods
Flutter programs
Experiments with Mobile
Stars: ✭ 308 (-0.96%)
Mutual labels:  gradient
Glnotificationbar
GLNotificationBar is a ios10 style notification bar, can be used to handle push notification in active state.
Stars: ✭ 306 (-1.61%)
Mutual labels:  cocoapods
Mevfloatingbutton
An iOS drop-in UITableView, UICollectionView and UIScrollView superclass category for showing a customizable floating button on top of it.
Stars: ✭ 301 (-3.22%)
Mutual labels:  cocoapods
Material Showcase Ios
✨ An elegant way to guide your beloved users in iOS apps - Material Showcase.
Stars: ✭ 300 (-3.54%)
Mutual labels:  cocoapods

GradientProgressBar

Swift5.0 CI Status Code Coverage Version License Platform

A customizable gradient progress bar (UIProgressView). Inspired by iOS 7 Progress Bar from Codepen.

Example

Example

To run the example project, clone the repo, and open the workspace from the Example directory.

Requirements

  • Swift 5.0
  • Xcode 11
  • iOS 9.0+

Integration

CocoaPods

CocoaPods 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:

pod 'GradientProgressBar', '~> 2.0'
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:

github "fxm90/GradientProgressBar" ~> 2.0

Run carthage update to build the framework and drag the built GradientProgressBar.framework, as well as the dependency LightweightObservable.framework, into your Xcode project.

Swift Package Manager

The Swift 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.

Once 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.

dependencies: [
    .package(url: "https://github.com/fxm90/GradientProgressBar", from: "2.0.3")
]

How to use

Simply drop a UIView into your View Controller in the Storyboard. Select your view and in the Identity Inspector change the class to GradientProgressBar.

Don't forget to change the module to GradientProgressBar too.

Interface Builder

Setup the constraints for the UIView according to your needs.

Import GradientProgressBar in your view controller source file.

import GradientProgressBar

Create an IBOutlet of the progress view in your view controller source file.

@IBOutlet weak var gradientProgressView: GradientProgressBar!

After that you can set the progress programmatically as you would do on a normal UIProgressView.

gradientProgressView.setProgress(0.75, animated: true)
gradientProgressView.progress = 0.75

Configuration

– Property animationDuration

Adjusts the animation duration for calls to setProgress(_:animated:):

progressView.animationDuration = 2.0
progressView.setProgress(progress, animated: true)

– Property gradientColors

Adjusts the colors, used for the gradient inside the progress-view.

progressView.gradientColors: [UIColor] = [
    .red,
    .white,
    .blue
]

– Property timingFunction

Adjusts the timing function for calls to setProgress(_:animated:), with animated set to true.

progressView.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)

Troubleshooting

Interface Builder Support

Unfortunatly 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 :)

  post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
      next unless config.name == 'Debug'

      config.build_settings['LD_RUNPATH_SEARCH_PATHS'] = [
        '$(FRAMEWORK_SEARCH_PATHS)'
      ]
    end
  end

Source: Cocoapods – Issue 7606

Show progress of WKWebView

Based on my gist, 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.

Please have a look at the example application for further details :)

Author

Felix Mau (me(@)felix.hamburg)

License

GradientProgressBar is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].