pro

Progressable

Lightweight component to create an horizontal loading bar on any UIView

Showing:

Popularity

Downloads/wk

0

GitHub Stars

37

Maintenance

Last Commit

5yrs ago

Contributors

2

Package

Dependencies

0

License

MIT

Categories

Readme

Progressable

Build Status CocoaPods Compatible

Progressable is a simple component to help you add a simple animatable progress bar to any UIView.

Usage

3 simple steps to follow:

  • make your UIView conform to the Progressable protocol.
  • call self.initProgress() in init(frame: CGRect) and init?(coder aDecoder: NSCoder).
  • call self.layoutProgress() in func layoutSubviews().

API

After conforming to the Progressable protocol, you change the progress using:

  • the progress property: self.progressView.progress = 50 (values are from 0 to 100).
  • the setProgress(progress: CGFloat, withDuration duration: TimeInterval) method.

The following properties can be customized:

  • progressLineWidth: width of the progress bar.
  • progressColor: color of the progress bar.

Example

class ProgressSearchBar: UISearchBar, Progressable {
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.initProgress()
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.initProgress()
    }

    override func layoutSubviews() {
        super.layoutSubviews()
        self.layoutProgress()
    }
}

This example can be run using Progressable.xcodeproj.

Preview

progress

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100