Skip to content

A Circular progress view written in Swift because these controls always come in handy.

License

Notifications You must be signed in to change notification settings

hsuanchih/CCCircularProgressView-Swift

Repository files navigation

CCCircularProgressView-Swift

Circular progress view written in Swift because these controls always come in handy.

CI Status Version License Platform

Demo

Demo

Usage

Adding Circular Progress View

  • Add CCGCircularProgressView instance to your view (OR, in Interface Builder, set an UIView's Custom Class to CCGCircularProgressView).

Customisations

Customisable Properties:

  • roundedCorner
  • radius
  • startAngle
  • lineColor
  • lineWidth
  • trackColor
  • trackWidth

Customise using Attributes Inspector in Interface Builder

InterfaceBuilder

Customise Programmatically

class ViewController: UIViewController {
    
    @IBOutlet weak var progressView : CCCircularProgressView! {
        didSet {
            progressView.isBarRounded = true
            progressView.radius = 140
            progressView.startAngle = -CGFloat.pi/2
            progressView.lineColor = .red
            progressView.lineWidth = 20
            progressView.trackColor = .lightGray
            progressView.trackWidth = 25
        }
    }
    .
    .
}

Update Progress

// Progress value is between 0 and 1
progressView.progress = 0.5

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

CCCircularProgressView-Swift is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'CCCircularProgressView-Swift'

Author

Hsuan-Chih Chuang, [email protected]

License

CCCircularProgressView-Swift is available under the MIT license. See the LICENSE file for more info.

About

A Circular progress view written in Swift because these controls always come in handy.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published