Latest 1.0.0
Homepage https://github.com/yalight/ProgressTrack
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

A progress track like the one used in SoundCloud.com

Screenshots

Demo

Usage

Basic usage

Add ProgressTrack.swift into your project.

import UIKit

class ViewController: UIViewController, ProgressTrackDelegate {    
    @IBOutlet var progressTrack1: ProgressTrack!

    override func viewDidLoad() {
        super.viewDidLoad()

        progressTrack1.trackData = [0.2, 0.3, 0.8, 0.7, 0.6, 0.7, 0.8, 0.9, 1.0, 0.8, 0.4, 0.1]
        progressTrack1.delegate = self
    }

    func progressTrackBarTappedUp(progressTrack: ProgressTrack, fromProgressValue: Float, toProgressValue: Float) {
        let fromBarIndex = progressTrack.getBarIndexByProgressValue(fromProgressValue)
        let toBarIndex = progressTrack.getBarIndexByProgressValue(toProgressValue)

        let fromBarValue = progressTrack.trackData[fromBarIndex]
        let toBarValue = progressTrack.trackData[toBarIndex]

        print("barTapped fromBarIndex:[(fromBarIndex)]=(fromBarValue) toBarIndex:[(toBarIndex)]=(toBarValue) (toProgressValue)")
    }
}

Requirements

  • iOS 7 or higher
  • Automatic Reference Counting (ARC)

Author

License

ProgressTrack is released under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ProgressTrack",
    "version": "1.0.0",
    "summary": "A progress track like the one used in SoundCloud.com.",
    "homepage": "https://github.com/yalight/ProgressTrack",
    "license": "MIT",
    "authors": {
        "yalight": "[email protected]"
    },
    "source": {
        "git": "https://github.com/yalight/ProgressTrack.git",
        "tag": "1.0.0"
    },
    "source_files": "ProgressTrack/*.{swift}",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This