MKAIndicatorView 2.0.0

MKAIndicatorView 2.0.0

Maintained by Hituzi Ando.



  • By
  • Hituzi Ando

MKAIndicatorView

MKAIndicatorView makes you to create the powerful indicator view easily.

Include in your iOS app

CocoaPods

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

pod "MKAIndicatorView"

Manual Installation

  1. Download latest MKAIndicatorView
  2. Drag & Drop MKAIndicatorView.framework into your Xcode project

Usage

  1. Import the module

    Objective-C

    #import <MKAIndicatorView/MKAIndicatorView.h>

    Swift

    import MKAIndicatorView
  2. Show the indicator

    Objective-C

    [[MKAIndicator basicIndicatorWithActivityIndicatorViewStyle:UIActivityIndicatorViewStyleGray]
                   showInView:self.view withTouchDisabled:NO];

    Swift

    MKAIndicator.basicIndicator(with: .gray).show(in: self.view, withTouchDisabled: false)
  3. Hide the indicator

    Objective-C

    [[MKAIndicator currentIndicator] hide];

    Swift

    MKAIndicator.current().hide()

Basic Type

Objective-C

// Show basic indicator.
[[[MKAIndicator basicIndicatorWithActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhiteLarge]
                addBlackBackgroundView]
                showInView:self.view withTouchDisabled:NO];

Swift

// Show basic indicator.
MKAIndicator.basicIndicator(with: .whiteLarge)
            .addBlackBackgroundView()
            .show(in: self.view, withTouchDisabled: false)

Custom Type

Objective-C

// Show custom indicator.
[[[MKAIndicator customIndicatorWithIndicatorViewImage:[UIImage imageNamed:@"spinner"]]
                setAnimationDuration:1.0]
                showInView:self.view withTouchDisabled:NO];

Swift

// Show custom indicator.
MKAIndicator.customIndicator(withIndicatorViewImage: UIImage(named: "spinner")!)
            .setAnimationDuration(1.0)
            .show(in: self.view, withTouchDisabled: false)

Sprite Animation Type

Objective-C

// Show sprite animation indicator.
[[[MKAIndicator spriteAnimationIndicatorWithIndicatorViewImagesFormat:@"indicator%zd" count:8]
                setAnimationDuration:.5]
                showInView:self.view withTouchDisabled:NO];

Swift

// Show sprite animation indicator.
MKAIndicator.spriteAnimationIndicator(withIndicatorViewImagesFormat: "indicator%zd", count: 8)
            .setAnimationDuration(0.5)
            .show(in: self.view, withTouchDisabled: false)

Only Status Bar Type

Objective-C

// Show indicator on the status bar only.
[[MKAIndicator onlyStatusBarIndicator] showInView:self.view withTouchDisabled:NO];

Swift

// Show indicator on the status bar only.
MKAIndicator.onlyStatusBarIndicator().show(in: self.view, withTouchDisabled: false)

More info, see my sample project.