##Preview
MOLoaderView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "MOLoaderView"
This library uses POP animation engine by Facebook and UIBlurEffect
available from iOS 8.0
To run the example project, clone the repo, and run pod install
from the Example directory first.
Import the library
#import "MOLoaderView.h"
Initialize your loader using the blurred init
MOLoaderView *loader = [[MOLoaderView alloc] initWithRadius:100 strokeWidth:5.0
blurEffectStyle:0 strokeColor:[UIColor whiteColor]
showPercentage:YES withSymbol:YES
didCompleteBlock:^{
NSLog(@"COMPLETE!");
}];
Or the custom init to choose the combination of colors you like
MOLoaderView *loader = [[MOLoaderView alloc] initWithRadius:100 strokeWidth:5.0
backgroundCircleColor:[UIColor colorWithRed:0.435 green:0.443 blue:0.475 alpha:1.000]
circleColor:[UIColor colorWithRed:0.122 green:0.129 blue:0.141 alpha:1.000]
strokeColor:TINT_COLOR
showPercentage:YES withSymbol:NO
didCompleteBlock:^{
NSLog(@"COMPLETE!");
}];
Therefore, you can show the loader using
[loader showAtPoint:CGPointMake(self.view.center.x, self.view.frame.size.height/2) withZoomOut:NO];
[self.view addSubview:loader];
Increment the progress calling
[loader animateWithProgress:/*currentProgress*/];
And, once completed, hide it
[loader hide];
Mario Oriente, oriente.mario@gmail.com
MOLoaderView is available under the MIT license. See the LICENSE file for more info.