Latest 1.4.5
Homepage https://github.com/Cokile/CCActivityIndicatorView
License MIT
Platforms ios 8.0, requires ARC
Frameworks SystemConfiguration
Authors

CCActivityIndicatorView

CCActivityIndicatorView
CCActivityIndicatorView
CCActivityIndicatorView

Captures

CCActivityIndicatorView
CCActivityIndicatorView
CCActivityIndicatorView
CCActivityIndicatorView
CCActivityIndicatorView

Installation

Use Cocoapods

Simply add one line to your Podfile:

pod 'CCActivityIndicatorView'

Manually

Add the .h, .m files in the CCActivityIndicatorView folder to your project.

Add ImageIO.framework to your target.

Easy to use

#import "CCActivityIndicatorView.h"

self.myactivityIndicatorView = [CCActivityIndicatorView new];

// Show with the default type
// The 1st capture
[self.myactivityIndicatorView show];

Or you can specify the type to show

self.myactivityIndicatorView = [CCActivityIndicatorView new];

// CCActivityIndicatorView with type CCIndicatorTypeScalingDots
// The 1st capture
[self.myactivityIndicatorView showWithType:CCIndicatorTypeScalingDots];

// CCActivityIndicatorView with type CCIndicatorTypeLeadingDots
// The 2nd capture
[self.myactivityIndicatorView showWithType:CCIndicatorTypeLeadingDots];

// CCActivityIndicatorView with type CCIndicatorTypeCircle
// The 3rd capture
[self.myactivityIndicatorView showWithType:CCIndicatorTypeCircle];

// CCActivityIndicatorView with type CCIndicatorTypeArc
// The 4th capture
[self.myactivityIndicatorView showWithType:CCIndicatorTypeArc];

Or you can even use your own GIF file

self.myactivityIndicatorView = [CCActivityIndicatorView new];

// Show with GIF
// The 5th capture
[self.myactivityIndicatorView showWithGIFName:@"test.gif"];

Then when some tasks have completed, simply use

[self.myactivityIndicatorView dismiss];

Or you can display some text before dismiss

// The 1st capture
[self.myactivityIndicatorView dismissWithText:@"This is a sample dismiss text" delay:0.5];

Note:

You should not show CCActivityIndicatorView within viewDidLoad, The Animation will not work!

Instead, show it within viewWillAppear or viewDidAppear.

Customisable

Public properties

// Set public properties before showing it.

// Set the backgrond color. The default color is black.
self.myactivityIndicatorView.backColor = <#UIColor#>;

// Set the background border color. The default background color is black.
self.myactivityIndicatorView.borderColor = <#UIColor#>;

// Set the backgrond border width. THe default value is 0.
self.myactivityIndicatorView.borderWidth = <#CGFloat#>;

// Set the background corner radius. The default value is 10.0;
self.myactivityIndicatorView.cornerRadius = <#CGFloat#>;

// Set the indicator color. The default color is white.
self.myactivityIndicatorView.indicatorColor = <#UIColor#>;

// Set the boolean value that indicates whether the ohter UIViews are user-interactable. The default value is YES.
self.myactivityIndicatorView.isTheOnlyActiveView = <#BOOL#>;

// Set the appear animation type.
self.myactivityIndicatorView.appearAnimationType = <#CCIndicatorAppearAnimationType#>;

//  Set the disappear animation type.
self.myactivityIndicatorView.disappearAnimationType = <#CCIndicatorDisappearAnimationType#>;

// Set the background view type
self.myactivityIndicatorView.backgroundViewType = <#CCIndicatorBackgroundViewType#>;

Animation Type

Indicator animation type

typedef NS_ENUM(NSInteger, CCIndicatorType) {
    CCIndicatorTypeScalingDots, // Default type
    CCIndicatorTypeLeadingDots,
    CCIndicatorTypeCircle,
    CCIndicatorTypeArc
};

Appear animation type

typedef NS_ENUM(NSInteger, CCIndicatorAppearAnimationType) {
    CCIndicatorAppearAnimationTypeSlideFromTop,
    CCIndicatorAppearAnimationTypeSlideFromBottom,
    CCIndicatorAppearAnimationTypeSlideFromLeft,
    CCIndicatorAppearAnimationTypeSlideFromRight,
    CCIndicatorAppearAnimationTypeZoomIn,
    CCIndicatorAppearAnimationTypeFadeIn // Default type
};

Disappear animation type

typedef NS_ENUM(NSInteger, CCIndicatorDisappearAnimationType) {
    CCIndicatorDisappearAnimationTypeSlideToTop,
    CCIndicatorDisappearAnimationTypeSlideToBottom,
    CCIndicatorDisappearAnimationTypeSlideToLeft,
    CCIndicatorDisappearAnimationTypeSlideToRight,
    CCIndicatorDisappearAnimationTypeZoomOut,
    CCIndicatorDisappearAnimationTypeFadeOut // Default type
};

Background view type

typedef NS_ENUM(NSInteger, CCIndicatorBackgroundViewType) {
    CCIndicatorBackgroundViewTypeNone, // Default type
    CCIndicatorBackgroundViewTypeBlur,
    CCIndicatorBackgroundViewTypeTransparent,
    CCIndicatorBackgroundViewTypeShadow
};

Requirement

iOS 8.0 or later

Acknowledgement

uiimage-from-animated-gif : A UIImage category that loads animated GIFs.

TODO

  • More types of animation

Any Pull Requests are welcome.

Latest podspec

{
    "name": "CCActivityIndicatorView",
    "platforms": {
        "ios": "8.0"
    },
    "version": "1.4.5",
    "license": {
        "type": "MIT"
    },
    "homepage": "https://github.com/Cokile/CCActivityIndicatorView",
    "authors": {
        "Cokile": "[email protected]"
    },
    "summary": "A simple replacement for UIActivityIndicatorView.",
    "source": {
        "git": "https://github.com/Cokile/CCActivityIndicatorView.git",
        "tag": "v1.4.5"
    },
    "frameworks": "SystemConfiguration",
    "source_files": "CCActivityIndicatorView/*",
    "requires_arc": true
}

Pin It on Pinterest

Share This