Giter VIP home page Giter VIP logo

gdgauge's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.