will-tm / WMGaugeView

MIT License
405 stars 86 forks source link

swift implementation. #30

Open jessjpj opened 8 years ago

jessjpj commented 8 years ago

Is there any swift implementation of this project? I couldn't find any.

preetam-idyllic commented 7 years ago

Looking for same.

mahdigh99 commented 6 years ago

@preetam-idyllic @jessjpj

after pod install WMGaugeView go to storyboard add View and set View class to WMGaugeView

connect view to controller

then write below codes in your ViewController :

import WMGaugeView

class GaugeVC: UIViewController {

 @IBOutlet weak var myGauge: WMGaugeView!  //// Connect View to ViewController

 override func viewDidLoad() {
        super.viewDidLoad()

        myGauge.showRangeLabels = true
        myGauge.maxValue = 200
        myGauge.rangeValues = [50 ,  100 , 200]
        myGauge.rangeColors = [UIColor.green, UIColor.yellow , UIColor.red]
        myGauge.rangeLabels = ["low", "medium" , "High" ]
        myGauge.unitOfMeasurement = "Mile"
        myGauge.showUnitOfMeasurement = true
        myGauge.rangeLabelsFontColor = UIColor.black

        myGauge.setValue( 20 , animated: true, duration: 5) // Use this When you want gauge indicator show value

}

}

Use this When you want gauge indicator show value: myGauge.setValue( Float(gaugeValue) , animated: true, duration: 5)

creatorvm commented 6 years ago

Got a solution after 1 year. Thanks anyway.

RabiChourasiaOgma commented 5 years ago

I follow your above instructions., but when I import "WMGaugeView" getting error "No such module 'WMGaugeView'" in swift4.2 project so how can I resolve this issue?

mahdigh99 commented 5 years ago

I follow your above instructions., but when I import "WMGaugeView" getting error "No such module 'WMGaugeView'" in swift4.2 project so how can I resolve this issue?

do you try pod install and open YOUR_PROJECT_NAME.xcworkspace ????

RabiChourasiaOgma commented 5 years ago

I follow your above instructions., but when I import "WMGaugeView" getting error "No such module 'WMGaugeView'" in swift4.2 project so how can I resolve this issue?

do you try pod install and open YOUR_PROJECT_NAME.xcworkspace ???? yes..I did but getting error