- Interface builder designable
- Highly customizable and flexible
- Easy to use
- Sleek animations
- Written in Swift
-
GradePoint by Luis Padron.
-
UVI Mate by Alexander Ershov.
-
HotelTonight by Hotel Tonight Inc.
-
Install CocoaPods
-
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
-
Run
pod install
-
Open up the
.xcworkspace
that CocoaPods created -
Done!
To use with Carthage
-
Make sure Carthage is installed
brew install carthage
-
Add this repo to your Cartfile
github "luispadron/UICircularProgressRing"
-
Install dependencies
carthage update --platform iOS
- Drag the
UICircularProgressRing.framework
fromMyProjDir/Carthage/Builds/iOS/UICircularProgressRing
into theGeneral -> Embeded Binaries
section of your Xcode project.
- Drag the
UICircularProgressRing.framework
fromMyProjDir/Carthage/Builds/iOS/UICircularProgressRing
into theGeneral -> Linked Frameworks and Binaries
section of your Xcode project. - Add a run script phase, under
Build Phases -> +
, put this in the code for the run script:/usr/local/bin/carthage copy-frameworks
- Add a
Copy Files Phase
underBuild Phases -> +
, selectFrameworks
as destination and addUICircularProgressRing.framework
, make sureCode Sign On Copy
is enabled.
- Simply download the
UICircularProgressRingView.swift
,UICircularProgressRingLayer.swift
andUICiruclarProgressRingDelegate.swift
files from here into your project, make sure you point to your projects target
Simply drag a UIView
into your storyboard. Make sure to subclass UICircularProgressRingView
and that the module points UICircularProgressRing
.
Design your heart out
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...
}
Please read this before creating an issue about how to use the package:
Take a look at the example project over here
- Download it
- Open the
Example.xcworkspace
in Xcode - Mess around and experiment!
Do you use this library? Want to be featured? Go here.