Latest 0.1.0
Homepage https://github.com/Gwinyai/GNGaugeView
License MIT
Platforms ios 11.4
Authors

A visual gauge built with Swift that can be used as a speedometer to track speed of travel. Useful for giving a visual display of the speed of walking, running or any other kind of fitness activity.

alt text

Installing

$ pod install GNGaugeView

or in your Podfile

pod 'GNGaugeView'

Usage

Subclass a UIView with GNGaugeView in Storyboard or instantiate a GNGaugeView. Specify any desired configurations such as a minimum and maximum speed for your gauge. Use the function rotateGauge(newSpeed: CGFloat) to rotate the gauge to a new speed. In the example below we use a UISlider to rotate the gauge:

import UIKit 

class ViewController: UIViewController {

  @IBOutlet weak var gaugeView: GNGaugeView!

  @IBOutlet weak var gaugeSlider: UISlider!

  override func viewDidLoad() {
        super.viewDidLoad()

        gaugeView.minSpeed = 0

        gaugeView.maxSpeed = 30

   }

   @IBAction func sliderDidChange(_ sender: UISlider) {

        let sliderValue = sender.value

        let speed = gaugeView.maxSpeed * CGFloat(sliderValue)

        gaugeView.rotateGauge(newSpeed: speed)

    }

}

Example

An example project is included which shows how to use GNGaugeView with Core Motion to get the speed of walking or running.

Authors

  • Gwinyai NyatsokaInitial workGwinyai

License

This project is licensed under the MIT License – see the LICENSE.md file for details.

Latest podspec

{
    "name": "GNGaugeView",
    "version": "0.1.0",
    "summary": "A visual gauge built with Swift that can be used as a speedometer to track speed of travel.",
    "description": "A useful visual gauge that will display the speed of walking, running or any other kind of fitness activity.",
    "homepage": "https://github.com/Gwinyai/GNGaugeView",
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "authors": {
        "Gwinyai Nyatsoka": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Gwinyai/GNGaugeView.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "11.4"
    },
    "source_files": "GNGaugeView/*.swift",
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This