Latest 1.0.5
Homepage https://github.com/naeemjawaid/VerticalProgressView
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

Description

A vertical progress view created from UIProgressView.

Example Use

import VerticalProgressView

class ViewController: UIViewController {

    let verticalProgressView: VerticalProgressView = {
        let progressView = VerticalProgressView()
        progressView.translatesAutoresizingMaskIntoConstraints = false
        return progressView
    }()

    override func viewDidLoad() {
        super.viewDidLoad()
        addVerticalProgressView()
        verticalProgressView.setProgress(0.7, animated: false)
    }

    private func addVerticalProgressView() {
        view.addSubview(verticalProgressView)
        verticalProgressView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
        verticalProgressView.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
        verticalProgressView.widthAnchor.constraint(equalToConstant: 6).isActive = true
        verticalProgressView.heightAnchor.constraint(equalTo: view.heightAnchor, multiplier: 0.7).isActive = true
    }
}

ViewController

Alternatively you can add a UIView and storyboard and set its class to VerticalProgressView, and play constraints there.

Moreover if you dont want to use AutoLayout, simply add it like:

override func viewDidLoad() {
        super.viewDidLoad()

        let verticalProgressView = VerticalProgressView(frame: CGRect(x: 30, y: 30, width: 6, height: 100))
        view.addSubview(verticalProgressView)
        verticalProgressView.setProgress(0.7, animated: false)
}

Customization

// Make the progress view descending
verticalProgressView.isAscending = false  // Defaults to true

// Set progress image
verticalProgressView.progressImage = UIImage(named: "ProgressImage.png")

// Read progress
let progress = verticalProgressView.progress

// Set progress
verticalProgressView.setProgress(0.6, animated: true)   // Perform on main thread

// Set progress tint color
verticalProgressView.progressTintColor = .red

// Set progress view style
verticalProgressView.progressViewStyle = .bar

// Set track image
verticalProgressView.trackImage = UIImage(named: "TrackImage.png")

// Set track tint color
verticalProgressView.trackTintColor = .darkGray

Installation

VerticalProgressView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "VerticalProgressView"

Author

Muhammad Naeem Jawaid, [email protected]

License

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

Latest podspec

{
    "name": "VerticalProgressView",
    "version": "1.0.5",
    "summary": "A vertical progress view created from UIProgressView.",
    "description": "VerticalProgressView is a completely customizable vertical progress view that can be used in any iOS app.",
    "homepage": "https://github.com/naeemjawaid/VerticalProgressView",
    "license": "MIT",
    "authors": {
        "Muhammad Naeem Jawaid": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/naeemjawaid/VerticalProgressView.git",
        "tag": "1.0.5"
    },
    "source_files": [
        "VerticalProgressView",
        "VerticalProgressView/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This