Swiftpack.co - Package - luispadron/UICircularProgressRing

Banner

A circular progress bar for iOS written in Swift

Styles

Features

  • Interface builder designable
  • Highly customizable and flexible
  • Easy to use
  • Fluid and interruptible animations
  • Written in Swift
  • RTL language support

Apps Usig UICircularProgressRing

Installation

CocoaPods (Recommended)

  1. Install CocoaPods

  2. Add this repo to your Podfile

    target 'Example' do
        # IMPORTANT: Make sure use_frameworks! is included at the top of the file
        use_frameworks!
    
        pod 'UICircularProgressRing'
    end
    
  3. Run pod install

  4. Open up the .xcworkspace that CocoaPods created

  5. Done!

Carthage

Important: Interface builder support with Carthage is either broken or extremely limted

To use with Carthage

  1. Make sure Carthage is installed

    brew install carthage

  2. Add this repo to your Cartfile

    github "luispadron/UICircularProgressRing"

  3. Install dependencies carthage update --platform iOS

Usage

Interface Builder

Simply drag a UIView into your storyboard. Make sure to subclass UICircularProgressRing and that the module points to UICircularProgressRing.

Design your heart out

ib-demo.gif

Code

override func viewDidLoad() {
  // Create the view
  let progressRing = UICircularProgressRing(frame: CGRect(x: 0, y: 0, width: 240, height: 240))
  // Change any of the properties you'd like
  progressRing.maxValue = 50
  progressRing.innerRingColor = UIColor.blue
  // etc ...
}

To set a value and animate the view

// Somewhere not in viewDidLoad (since the views have not set yet, thus cannot be animated)
// Remember to use unowned or weak self if refrencing self to avoid retain cycle
progressRing.startProgress(to: 49, duration: 2.0) {
  print("Done animating!")
  // Do anything your heart desires...
}

// Pause at any time during a running animation
progressRing.pauseProgress()

// Continue where you left off after a pause
progressRing.continueProgress()

Documentation

Please read this before creating an issue about how to use the package:

DOCUMENTATION

Example project

Take a look at the example playground over here

  1. Download it
  2. Mess around and experiment!

Misc.

Do you use this library? Want to be featured? Go here.

Github

link
Stars: 770
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

v3.1.0 - Jul 17, 2018

Version 3.1.0

  • Adds three new properties for more fine-grained control of the progress knob. valueKnobShadowBlur, valueKnobShadowOffset, and valueKnobShadowColor. Thanks to @xismic for the contribution!

v3.0.0 - Jun 27, 2018

Version 3.0.0

Tons of new features and improvements!

  • Add new properties showsValueKnob, valueKnobColor, and valueKnobSize as requested by #97
  • Add new continueProgress, pauseProgress, and resetProgress functions which allow fluid continuation and pausing of progress animations.
  • Add new delegate functions didPauseProgress, and didContinueProgress
  • Tons of refactoring and renaming of properties/functionality

Breaking API Changes

Lots please refer to the documentation to get your code up to spec with version 3.0.0

v2.2.0 - Jun 22, 2018

Version 2.2.0

  • Add new isClockwise property which allows users of the library to set whether or not the ring should rotate in a clockwise fashion.

Thanks to @petewalker for adding this!

v2.1.3 - Jun 22, 2018

  • Add example playground

v2.1.2 - Jun 20, 2018

Enable app safe extension API