Giter VIP home page Giter VIP logo

amloadingspinner's Introduction

AMLoadingSpinner

Pod Version Platforms License

AMLoadingSpinner is a simple way to show animated spinner for displaying the progress of an ongoing task.

Getting started

From CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AMLoadingSpinner in your projects. First, add the following line to your Podfile:

pod 'AMLoadingSpinner'

Second, install AMLoadingSpinner into your project:

pod install

Manually

Drag the AMLoadingSpinner/AMLoadingSpinner folder into your project.

Usage

AMLoadingSpinner is a singleton, which will always be shown as full-screen subview of application's key window. This spinner has no default animations, so to use it you need to have an image sequence of your animation (array of images).

Customization

Foreground

Required
+(void) setAnimationImages:(NSArray <UIImage *>*)images;

You can pass a single-object array in this method to get static image without animation.

Optional
+(void) setAnimationDuration:(NSTimeInterval)duration;   // Default is 5.0 seconds
+(void)setForegroundImageViewSize:(CGSize)size;          // Default is (100, 100)

Note that spinner will always be shown in the middle of the screen.

Background

You can choose the type of spinner's background view. Type of background is enum AMLoadingSpinnerBackgroundType and it have 4 values:

AMLoadingSpinnerBackgroundTypeFullScreen    // Full-screen background view                   
AMLoadingSpinnerBackgroundTypeClear         // Background view is not shown
AMLoadingSpinnerBackgroundTypeDefaultView   // Background view is rectangle or square
AMLoadingSpinnerBackgroundTypeCustomView    // Custom background view

You can customize background view with these methods:

Optional
+(void) setBackgroundType:(AMLoadingSpinnerBackgroundType)type;   // Default is AMLoadingSpinnerBackgroundTypeClear

//Works ONLY when for AMLoadingSpinnerBackgroundTypeCustomView type
+(void) setBackgroundView:(UIView *)view;

//Works ONLY when for AMLoadingSpinnerBackgroundTypeDefaultView type
+(void) setBackgroundViewSize:(CGSize)size;               // Default is (200, 200)
+(void) setBackgroundViewCornerRadius:(CGFloat)radius;    // Default is 10.0

//Works ONLY when for AMLoadingSpinnerBackgroundTypeDefaultView and AMLoadingSpinnerBackgroundTypeFullScreen types
+(void) setBackgroundViewColor:(UIColor *)color;       // Default is (255, 255, 255, 0.7)

Actions

To show/hide spinner, use these methods:

Showing

+(void) show;                                
+(void) showWithProgress:(CGFloat)progress;

Dismissing

+(void) dismiss;                                  
+(void) dismissWithDelay:(NSTimeInterval)delay;

Note, that user interaction with app is disabled while spinner is showing.

License

AMLoadingSpinner is distributed under the terms and conditions of the MIT license.

Credits

AMLoadingSpinner is developed by Artem Mihaylov. If you're using AMLoadingSpinner in your project, attribution would be very appreciated.

amloadingspinner's People

Contributors

mihaylovartem avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

carabina babonov

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.