CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

NBGaugeView 0.1.0

NBGaugeView 0.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Nov 2016
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Nikhil.



  • By
  • NikhilBatra

Screenshot

Introduction

NBGaugeView is a small library to create and display Gauge Views. It is fully customizable: you can set the color, size, text and many other properties of the gauge. This is a simple donut used for displaying text in hollow circle.

Requirements

  • iOS 8+
  • Xcode 9.0+

Installation

Manual Install

Download NBGaugeVIew and import NBGaugeView.swift inside your xcode project.

Sample App

To start using NBGaugeView you can build the provided example project

  1. Open Example/NBGaugeView.xcodeproj in Xcode.
  2. Build and run.

Usage

It's very easy to set up, just import NBGaugeView in your Swift code:

import NBGaugeView

Interface Builder:

Add an UIView with interface builder and set NBGaugeView as UIView custom class.

Link it with the outlet property declared in your code.

@IBOutlet private weak var gaugeView: NBGaugeView!

It's simple to customize! Here's an example of configuration of the view.

gaugeView.startAngle = 0
gaugeView.percentage = 60
gaugeView.thickness = 20
gaugeView.labelFont = UIFont.systemFont(ofSize: 40)
gaugeView.labelColor = UIColor.red
gaugeView.gaugeBackgroundColor = UIColor.gray
gaugeView.gaugeColor = UIColor.blue

Radius

Radius fo the view is automatically adjusted with min of width and height of the view.

Radius can be fetched using the below property at anytime.

let radius = gaugeView.radius

License

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