Skip to content

Commit f88e376

Browse files
authored
Merge pull request #14 from devSC/feature-dev
Fix bug [#13]
2 parents d7c2ed1 + d605f67 commit f88e376

File tree

6 files changed

+36
-28
lines changed

6 files changed

+36
-28
lines changed

Demo/WSProgressHUD/WSProgressHUD.m

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ - (void)showHudViewWithAnimation
419419
delay:0
420420
options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState
421421
animations:^{
422-
self.hudView.transform = CGAffineTransformScale(self.hudView.transform, 1/1.2, 1/1.2);
422+
self.hudView.transform = CGAffineTransformIdentity;
423423
self.hudView.alpha = 1;
424424
}
425425
completion:^(BOOL finished){
@@ -467,24 +467,27 @@ - (void)dismiss
467467
self.hudView.transform = CGAffineTransformIdentity;
468468
[UIView animateWithDuration:WSProgressHUDDismissDuration
469469
delay:0
470-
options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationCurveEaseOut
470+
options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState
471471
animations:^{
472472
self.hudView.transform = CGAffineTransformScale(self.hudView.transform, .8, .8);
473473
self.hudView.alpha = 0;
474474
}
475475
completion:^(BOOL finished){
476-
self.hudView.transform = CGAffineTransformIdentity;
477476

478-
[self.overlayView removeFromSuperview];
479-
480-
self.userInteractionEnabled = NO;
481-
482-
[self stopIndicatorAnimation];
483-
484-
//Call drawInRact
485-
[self setNeedsDisplay];
486-
487-
[self setProgressHUDIndicatorStyle:self.indicatorStyle];
477+
if (self.hudView.alpha == 0) {
478+
self.hudView.transform = CGAffineTransformIdentity;
479+
480+
[self.overlayView removeFromSuperview];
481+
482+
self.userInteractionEnabled = NO;
483+
484+
[self stopIndicatorAnimation];
485+
486+
//Call drawInRact
487+
[self setNeedsDisplay];
488+
489+
[self setProgressHUDIndicatorStyle:self.indicatorStyle];
490+
}
488491
}];
489492
}
490493

WSProgressHUD.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "WSProgressHUD"
19-
s.version = "1.1.1"
19+
s.version = "1.1.2"
2020
s.summary = "WSProgressHUD is a beauful hud view for iPhone & iPad."
2121

2222
s.description = <<-DESC
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
3434

3535
s.author = { "袁仕崇" => "[email protected]" }
3636
s.platform = :ios, "6.0"
37-
s.source = { :git => "https://github.com/devSC/WSProgressHUD.git", :tag => "1.1.1" }
37+
s.source = { :git => "https://github.com/devSC/WSProgressHUD.git", :tag => "1.1.2" }
3838
s.source_files = "WSProgressHUD/*"
3939
s.exclude_files = "Demo/Exclude"
4040

WSProgressHUD/MMMaterialDesignSpinner.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder {
3636

3737
- (void)awakeFromNib
3838
{
39+
[super awakeFromNib];
40+
3941
[self initialize];
4042
}
4143

1.21 KB
Loading
1.02 KB
Loading

WSProgressHUD/WSProgressHUD.m

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ - (void)showHudViewWithAnimation
419419
delay:0
420420
options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState
421421
animations:^{
422-
self.hudView.transform = CGAffineTransformScale(self.hudView.transform, 1/1.2, 1/1.2);
422+
self.hudView.transform = CGAffineTransformIdentity;
423423
self.hudView.alpha = 1;
424424
}
425425
completion:^(BOOL finished){
@@ -467,24 +467,27 @@ - (void)dismiss
467467
self.hudView.transform = CGAffineTransformIdentity;
468468
[UIView animateWithDuration:WSProgressHUDDismissDuration
469469
delay:0
470-
options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationCurveEaseOut
470+
options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState
471471
animations:^{
472472
self.hudView.transform = CGAffineTransformScale(self.hudView.transform, .8, .8);
473473
self.hudView.alpha = 0;
474474
}
475475
completion:^(BOOL finished){
476-
self.hudView.transform = CGAffineTransformIdentity;
477476

478-
[self.overlayView removeFromSuperview];
479-
480-
self.userInteractionEnabled = NO;
481-
482-
[self stopIndicatorAnimation];
483-
484-
//Call drawInRact
485-
[self setNeedsDisplay];
486-
487-
[self setProgressHUDIndicatorStyle:self.indicatorStyle];
477+
if (self.hudView.alpha == 0) {
478+
self.hudView.transform = CGAffineTransformIdentity;
479+
480+
[self.overlayView removeFromSuperview];
481+
482+
self.userInteractionEnabled = NO;
483+
484+
[self stopIndicatorAnimation];
485+
486+
//Call drawInRact
487+
[self setNeedsDisplay];
488+
489+
[self setProgressHUDIndicatorStyle:self.indicatorStyle];
490+
}
488491
}];
489492
}
490493

0 commit comments

Comments
 (0)