Latest 2.0.0
Homepage https://github.com/HituziANDO/MKAIndicatorView
License MIT
Platforms ios 9.3, requires ARC
Authors

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

    // Set default indicator.
    MKAIndicator *indicator = [MKAIndicator basicIndicatorWithActivityIndicatorViewStyle:UIActivityIndicatorViewStyleGray];
    [MKAIndicator setDefaultIndicator:indicator];
    [[MKAIndicator defaultIndicator] showInView:self.view withTouchDisabled:NO];

    Swift

    // Set default indicator.
    let indicator = MKAIndicator.basicIndicator(with: .gray)
    MKAIndicator.setDefault(indicator)
    MKAIndicator.default().show(in: self.view, withTouchDisabled: false)
  3. Hide the indicator

    Objective-C

    [[MKAIndicator defaultIndicator] hide];

    Swift

    MKAIndicator.default().hide()

Basic Type

Objective-C

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

Swift

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

Custom Type

Objective-C

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

Swift

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

Sprite Animation Type

Objective-C

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

Swift

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

Only Status Bar Type

Objective-C

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

Swift

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

[KNOWN ISSUE] The onlyStatusBarIndicator is not working for iPhone X series.

More info, see my sample project.

Latest podspec

{
    "name": "MKAIndicatorView",
    "version": "2.0.0",
    "summary": "MKAIndicatorView is the simple and powerful indicator view.",
    "description": "MKAIndicatorView makes you to create the powerful indicator view easily.",
    "homepage": "https://github.com/HituziANDO/MKAIndicatorView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Hituzi Ando": "[email protected]"
    },
    "platforms": {
        "ios": "9.3"
    },
    "source": {
        "git": "https://github.com/HituziANDO/MKAIndicatorView.git",
        "tag": "2.0.0"
    },
    "source_files": "MKAIndicatorView/MKAIndicatorView/**/*.{h,m}",
    "exclude_files": [
        "MKAIndicatorView/build/*",
        "MKAIndicatorView/Framework/*"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This