Skip to content
forked from saeid/GDGauge

Full Customizable, Beautiful, Easy to use gauge view

License

Notifications You must be signed in to change notification settings

hazemmaher92/GDGauge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GDGauge

Full Customizable, Beautiful gauge view.

Completely written with ShapeLayers and CoreGraphic to get a most clean and smooth, everything!

[ Now with more options to customize! ]

1

2

gauge

Requirements

  • Xcode 9+
  • Swift 4
  • iOS 8+

Installation

Install manually

Drag GDGauge.swift to your project and use!

Using Cocoapods

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'GDGauge'
end

pod update then pod install

How to use

    override func viewDidLoad() {
        super.viewDidLoad()

        // Create and instatiate the view and set parameters
        speed = GDGaugeView(frame: view.bounds)
        
        // Set main gauge view color
        speed.baseColor = UIColor.cyan
        
        // Show circle border
        speed.showBorder = true
        
        // Show full circle border if .showBorder is set to true
        speed.fullBorder = false
        
        // Set starting degree based on zero degree on bottom center of circle space
        speed.startDegree = 45.0
        
        // Set ending degree based on zero degree on bottom center of circle space
        speed.endDegree = 270.0

        // Minimum value
        speed.min = 0.0
        
        // Maximum value
        speed.max = 16
        
        // Determine each step value
        speed.stepValue = 4.0
        
        // Color of handle
        speed.handleColor = UIColor.cyan
        
        // Color of seprators
        speed.sepratorColor = UIColor.black
        
        // Color of texts
        speed.textColor = UIColor.black
        
        // Center indicator text
        speed.unitText = "mb/s"
        
        // Center indicator font
        speed.unitTextFont = UIFont.systemFont(ofSize: 10)
        
        // Indicators text
        speed.textFont = UIFont.systemFont(ofSize: 20)
        view.addSubview(speed)

        /// After configuring the component, call setupView() method to create the gauge view
        speed.setupView() 

    }

Check sample project for details and lots of more info!

Licence

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

About

Full Customizable, Beautiful, Easy to use gauge view

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 90.1%
  • Ruby 7.1%
  • Objective-C 2.8%