Latest 0.6.1
Homepage https://github.com/ricwein/CircleProgressView
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

CircleProgressView

Version
License
Platform

An slim, AppStore like download-progress circle-indicator view.

All graphics are done using only CAShapeLayers with UIBezierPaths and are animated with CAAnimation. Therefor no additional assets are required, making all aspects fully customizable.

Preview old-Style:
UICircleProgressView UICircleProgressView

Preview new-Style:
UICircleProgressView UICircleProgressView

Installation

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

pod 'UICircleProgressView'

Example

Use either:

  • the Interface-Builder to create a UIView and set it’s base-class to UICircleProgressView
  • create a UICircleProgressView in source:
import UICircleProgressView

let progressView = UICircleProgressView(frame: CGRect(x: 0, y: 0, width: 24, height: 24), style: .new, status: .waiting)
progressView.tintColor = .blue

// starting download...
progressView.status = .downloading

for progress in stride(from: 0.0, to: 1.0, by: 0.01) {
    progressView.progress = CGFloat(progress)
    usleep(20000)
}
progressView.status = .success

For a full example-project see: example.xcodeproj or just the ViewController.swift

Usage

The following properties are exposed to customize and controll the progressView:

property behavior type / values
status the current progess-state enum: DownloadStatus
[.paused,.waiting,
.downloading,.success,
.canceled]
style the UI-style of the progressView enum: StyleType
[.old,.new]
progress the current progress Float (0.01.0)
strokeWidth explicitly set the progress-circle stroke width CGFloat
strokeDynamic use either: the explicit strokeWidth value for the progress-circle stroke, or calculate it dynamically Bool
colorSuccess/
colorPaused/
colorCanceled/
tintColor
set the progress colors UIColor

All of these properties can also be set in the XCode-Interfacebuilder, thanks to @IBDesignable:
UICircleProgressView

Button

This library also offers a button-version of the circle-progress to mimic the AppStore download-buttons.
The usage is mostly identical to the progressView, just use UICircleProgressButton instead.

Additionally to the described properties of the progressView, the Button supports:

property behavior type / values
startImage the button imageview which should be shown when the progress is currently stopped UIImage?
stopImage the button imageview which should be shown when the progress is currently downloading/waiting UIImage?

License

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

Latest podspec

{
    "name": "UICircleProgressView",
    "version": "0.6.1",
    "summary": "An AppStore like download-progress circle-indicator view.",
    "description": "An Apple AppStore like download-progress indicator.nShows a progress-circle which changes according to the current status and progress into a full circle.",
    "homepage": "https://github.com/ricwein/CircleProgressView",
    "screenshots": [
        "https://raw.githubusercontent.com/ricwein/CircleProgressView/master/images/old/downloading.png",
        "https://raw.githubusercontent.com/ricwein/CircleProgressView/master/images/old/success.png",
        "https://raw.githubusercontent.com/ricwein/CircleProgressView/master/images/new/downloading.png",
        "https://raw.githubusercontent.com/ricwein/CircleProgressView/master/images/new/waiting.png"
    ],
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Richard Weinhold": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ricwein/CircleProgressView.git",
        "tag": "0.6.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "5.0",
    "source_files": "UICircleProgressView/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This