Giter Club home page Giter Club logo

uicircularprogressring's Introduction

Banner

A circular progress bar for iOS written in Swift

Styles

Features

  • Interface builder designable
  • Highly customizable and flexible
  • Easy to use
  • Sleek animations
  • Written in Swift

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 note: Carthage support for IBDesignable and IBInspectable is broken due to how frameworks work. So if you decide on using Carthage, you will not be able to use IB to design this view. Take a look here for the issue.

To use with Carthage

  1. Make sure Carthage is installed

    brew install carthage

  2. Add this repo to your Cartfile

    github "luispadron/UICircularProgressRing"

  3. Drag the UICircularProgressRing.framework from MyProjDir/Carthage/Builds/iOS/UICircularProgressRing into the General -> Embeded Binaries section of your Xcode project.

Manually

  1. Simply download the UICircularProgressRingView.swift, UICircularProgressRingLayer.swift and UICiruclarProgressRingDelegate.swift files from here into your project, make sure you point to your projects target

Usage

Interface Builder

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

Design your heart out

ib-demo.gif

Code

override func viewDidLoad() {
  // Create the view
  let progressRing = UICircularProgressRingView(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.setProgress(value: 49, animationDuration: 2.0) {
  print("Done animating!")
  // Do anything your heart desires...
}

Documentation

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

DOCUMENTATION

Example project

Take a look at the example project over here

  1. Download it
  2. Open the Example.xcworkspace in Xcode
  3. Mess around and experiment!

Misc.

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

uicircularprogressring's People

Contributors

luispadron avatar phil-radius avatar bobgilmore avatar ptescher avatar younatics avatar swifttsubame avatar

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.