Latest 2.0.1
Homepage https://github.com/cp3hnu/CPLoading
License MIT
Platforms ios 8.0, requires ARC
Authors

CPLoading

CPLoading shows loading, progress and completion in the animation.

Inspired by the excellent MMMaterialDesignSpinner

Screenshot

Loaded successfully

Loaded unsuccessfully

Installation

Manually

The simplest way to install this library is to copy Classes/CPLoadingView.swift to your project.

CocoaPods

You can also install this library using CocoaPods. Just add this line to your Podfile:

pod 'CPLoadingView'

Then import library module like so:

import CPLoadingView

Properties

var lineWidth: CGFloat = 2.0

The line width of path of view.

var strokeColor: UIColor = UIColor(red: 0.0, green: 122.0/255.0, blue: 1.0, alpha: 1.0)

The stroke color of path of view.

var fontSize: Float = 30

The font size of progress

var hidesWhenCompleted: Bool = false

Whether to hide view when loading completed

var hidesAfterTime: NSTimeInterval = 0.5

The delay time to hide view

Usage

Start loading

loadingView.startLoading()

Set progress

loadingView.progress = 0.5

Complete loading successfully

loadingView.completeLoading(success: true)

Complete loading unsuccessfully

loadingView.completeLoading(success: false)

Requirements

  • Swift 3.0+
  • Xcode 8.0+

License

Released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "CPLoadingView",
    "version": "2.0.1",
    "summary": "CPLoading shows loading process and completes successfully or unsuccessfully in the animation.",
    "homepage": "https://github.com/cp3hnu/CPLoading",
    "license": "MIT",
    "authors": {
        "Wei Zhao": "[email protected]"
    },
    "source": {
        "git": "https://github.com/cp3hnu/CPLoading.git",
        "tag": "2.0.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Classes/*.swift"
}

Pin It on Pinterest

Share This