diff --git a/Example/MOLoaderView/MOViewController.m b/Example/MOLoaderView/MOViewController.m index 9448fde..aa692f4 100644 --- a/Example/MOLoaderView/MOViewController.m +++ b/Example/MOLoaderView/MOViewController.m @@ -93,7 +93,10 @@ - (IBAction)showButton:(id)sender }]; } - [self.loader showAtPoint:CGPointMake(self.view.center.x, self.view.frame.size.height/2) withZoomOut:self.showingZoomEffectSwitch.on]; +// [self.loader showAtPoint:CGPointMake(self.view.center.x, self.view.frame.size.height/2) withZoomOut:self.showingZoomEffectSwitch.on]; + + [self.loader show]; + [self.view addSubview:self.loader]; [self performSelector:@selector(startProgress) withObject:nil afterDelay:2]; } diff --git a/Pod/Classes/MOLoaderView.h b/Pod/Classes/MOLoaderView.h index 5f6a552..a06e004 100755 --- a/Pod/Classes/MOLoaderView.h +++ b/Pod/Classes/MOLoaderView.h @@ -17,6 +17,7 @@ typedef void(^LoaderViewBlock)(); -(void)waitingAnimation; -(void)animateWithProgress:(CGFloat)progress; -(void)showAtPoint:(CGPoint)center withZoomOut:(BOOL)zoomOut; +-(void)showWithZoomOut:(BOOL)zoomOut; // Presents the loader inside the current application window -(void)hide; -(instancetype)initWithRadius:(CGFloat)r strokeWidth:(CGFloat)width backgroundCircleColor:(UIColor *)backgroundCircleColor circleColor:(UIColor *)circleColor strokeColor:(UIColor *)strokeColor showPercentage:(BOOL)showPercentage withSymbol:(BOOL)showSymbol didCompleteBlock:(LoaderViewBlock)block; diff --git a/Pod/Classes/MOLoaderView.m b/Pod/Classes/MOLoaderView.m index 629f5f6..6b0531f 100755 --- a/Pod/Classes/MOLoaderView.m +++ b/Pod/Classes/MOLoaderView.m @@ -245,6 +245,14 @@ -(void)showAtPoint:(CGPoint)center withZoomOut:(BOOL)zoomOut [self performSelector:@selector(waitingAnimation) withObject:nil afterDelay:0]; } +-(void)showWithZoomOut:(BOOL)zoomOut{ + + UIWindow *window = [[[UIApplication sharedApplication] delegate] window]; + + [window addSubview:self]; + [self showAtPoint:CGPointMake(CGRectGetMidX(window.bounds), CGRectGetMidY(window.bounds)) withZoomOut:zoomOut]; +} + -(void)updatePercentageLabelWithProgress:(CGFloat)progress { if(_percentageLabel){