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
- Download latest MKAIndicatorView
- Drag & Drop MKAIndicatorView.framework into your Xcode project
Usage
-
Import the module
Objective-C
#import <MKAIndicatorView/MKAIndicatorView.h>
Swift
import MKAIndicatorView
-
Show the indicator
Objective-C
[[MKAIndicator basicIndicatorWithActivityIndicatorViewStyle:UIActivityIndicatorViewStyleGray] showInView:self.view withTouchDisabled:NO];
Swift
MKAIndicator.basicIndicator(with: .gray).show(in: self.view, withTouchDisabled: false)
-
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.