Git Product home page Git Product logo

circularspinner's Introduction

CircularSpinner

A Beautiful fullscreen Circular Spinner, very useful for determinate or indeterminate task. You can use it as activity indicator during loading.

Demo

Spinner demo

Installation

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

Swift 3:

pod 'CircularSpinner'

Swift 2.2:

pod 'CircularSpinner' ', '~> 0.2'

Objective-C:

use_frameworks!
pod 'CircularSpinner' , '~> 1.2.0'

Link the 'CircularSpinner.framework' to your target in Build Phases.

Usage

You can present the circular spinner from anywhere by calling the show() class method.

The default presentation mode is fullscreen, if you want present the spinner in a custom container view use this code before presenting it:

CircularSpinner.useContainerView(containerView)

Determinate Mode Example:

Presentation:

CircularSpinner.show(animated: true, showDismissButton: false, delegate: self)

Update the value by calling:

CircularSpinner.setValue(0.2, animated: true)

The spinner will automatically dismiss when it reaches the 100%, alternatively you can dismiss it manually by calling:

CircularSpinner.hide()

Indeterminate Mode Example:

Presentation:

CircularSpinner.show("Loading...", animated: true, type: .indeterminate)

Dismiss by calling:

CircularSpinner.hide()

Usage (example in Objective-C)

You can present the circular spinner from anywhere by calling the show() class method.

#import "ViewController.h"
#import <CircularSpinner/CircularSpinner-Swift.h>

@interface ViewController () <CircularSpinnerDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];
}

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[CircularSpinner show:@"Loading" animated: TRUE type:CircularSpinnerTypeDeterminate showDismissButton:[NSNumber numberWithBool:TRUE] delegate:self];
[CircularSpinner setValue:0.1 animated: TRUE];
}
@end

Delegate

There's one method in the CircularSpinnerDelegate that you can use to customize the appearance of the percentual Label:

@objc optional func circularSpinnerTitleForValue(_ value: Float) -> NSAttributedString

Author

taglia3, [email protected]

LinkedIn, Matteo Tagliafico

License

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

circularspinner's People

Contributors

mtagliafico avatar taglia3 avatar vvit avatar

Watchers

 avatar  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.