Skip to content

donnywdavis/DDProgressIndicator

Repository files navigation

DDProgressIndicator

Version License Platform

DDProgressIndicator is a simple class that can be used to display an activity indicator over any UIViewController.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

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

pod "DDProgressIndicator"

Usage

Import DDProgressIndicator and make sure that your view controller conforms to the DDProgressIndicatorDelegate protocol.

import DDProgressIndicator

class ViewController: UIViewController, DDProgressIndicatorDelegate {
    ...
}

Create a reference to the DDProgressIndicatorView class and set the delegate.

lazy var ddProgressIndicatorView: DDProgressIndicatorView = {
    var ddProgressIndicatorView = DDProgressIndicatorView(frame: CGRect(x: 0.0, y: 0.0, width: self.view.frame.width, height: self.view.frame.height))
    ddProgressIndicatorView.delegate = self
    return ddProgressIndicatorView
}()

There are two main methods to call to start and stop the activity indicator. Call these methods whenever you need to display the activity indicator.

ddProgressStartActivity()
ddProgressStopActivity()

There are three optional methods that can be used to modify the color for the activity spinner, the loading label, and the background.

func ddProgressIndicatorSetSpinnerColor() -> UIColor? {
    return UIColor.blueColor()
}
func ddProgressIndicatorSetLabelColor() -> UIColor? {
    return UIColor.blueColor()
}
func ddProgressIndicatorSetBackgroundColor() -> UIColor? {
    return UIColor.redColor()
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published