Latest 1.0.0
Homepage https://github.com/mac-gallagher/MultiProgressView
License MIT
Platforms ios 9.0
Authors

Swift-Version
CocoaPods
license
CocoaPods

About

MultiProgressView is an animatable progress bar that depicts multiple progresses over time. The MultiProgressView class mimics UIProgressView as much as possible while also providing additional customization options.

Example

To run the example project, clone the repo and run the MultiProgressView-Example target.

Requirements

  • iOS 9.0+
  • Xcode 10.0+
  • Swift 4.2

Installation

CocoaPods

MultiProgressView is available through let progressView = MultiProgressView() view.addSubview(progressView)

  • Conform your class to the MultiProgressViewDataSource protocol and set your progress view’s dataSource:

    func numberOfSections(in progressView: MultiProgressView) -> Int
    func progressBar(_ progressView: MultiProgressView, viewForSection section: Int) -> ProgressViewSection
    progressView.dataSource = self
  • Call the setProgress function to update your view’s progress:

    progressView.setProgress(section: 0, to: 0.4)
  • Customization

    MultiProgressView

    Each MultiProgressView exposes the following variables:

    var dataSource: MultiProgressViewDataSource?
    var totalProgress: Float
    
    var cornerRadius: CGFloat = 0
    var borderWidth: CGFloat = 0
    var borderColor: UIColor? = .black
    var lineCap: LineCapType = .round 
    
    var trackInset: CGFloat = 0
    var trackBackgroundColor: UIColor? = .white
    var trackBorderColor: UIColor? = .black
    var trackBorderWidth: CGFloat = 0
    var trackImageView: UIImageView?
    var trackTitleLabel: UILabel?
    var trackTitleEdgeInsets: UIEdgeInsets = .zero
    var trackTitleAlignment: AlignmentType = .center

    ProgressViewSection

    Each ProgressViewSection exposes the following variables:

    var imageView: UIImageView?
    var titleLabel: UILabel?
    var titleEdgeInsets: UIEdgeInsets = .zero
    var titleAlignment: AlignmentType = .center

    Animating your progress

    All of methods which alter the view’s progress can be animated. For example:

    UIView.animate(withDuration: 0.2) {
        self.progressView.setProgress(section: 0, to: 0.4)
    }

    Contributing

    • If you found a bug, open an issue and tag as bug.
    • If you have a feature request, open an issue and tag as feature.
    • If you want to contribute, submit a pull request.
      • In order to submit a pull request, please fork this repo and submit a pull request from your forked repo.
      • Have a detailed message as to what your pull request fixes/enhances/adds.

    To-do

    • [ ] Support for Carthage installation
    • [ ] Storyboard/IBInspectable support
    • [ ] Progress object (Foundation) support

    Author

    Mac Gallagher, [email protected]

    License

    MultiProgressView is available under the MIT License, see LICENSE for more infomation.

    Latest podspec

    {
        "name": "MultiProgressView",
        "version": "1.0.0",
        "platforms": {
            "ios": "9.0"
        },
        "summary": "An animatable progress bar that depicts multiple progresses over time",
        "description": "An animatable progress bar that depicts multiple progresses over time.",
        "homepage": "https://github.com/mac-gallagher/MultiProgressView",
        "documentation_url": "https://github.com/mac-gallagher/MultiProgressView/tree/master/README.md",
        "license": {
            "type": "MIT",
            "file": "LICENSE"
        },
        "authors": {
            "Mac Gallagher": "[email protected]"
        },
        "source": {
            "git": "https://github.com/mac-gallagher/MultiProgressView.git",
            "tag": "v1.0.0"
        },
        "swift_version": "4.2",
        "source_files": "MultiProgressView/Classes/**/*"
    }

    Pin It on Pinterest

    Share This