From 0e4b37b548bf730b729417f95e3c7741722c102c Mon Sep 17 00:00:00 2001 From: Jonas Gessner Date: Wed, 15 Apr 2015 00:55:15 +0200 Subject: [PATCH] 1.2.4 --- JGProgressHUD.podspec | 4 ++-- JGProgressHUD/JGProgressHUD/JGProgressHUD.h | 6 ++++-- JGProgressHUD/JGProgressHUD/JGProgressHUD.m | 17 ++++++++++------- README.md | 6 +++--- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/JGProgressHUD.podspec b/JGProgressHUD.podspec index c271b3e..7249102 100644 --- a/JGProgressHUD.podspec +++ b/JGProgressHUD.podspec @@ -1,14 +1,14 @@ Pod::Spec.new do |s| s.name = "JGProgressHUD" - s.version = "1.2.3" + s.version = "1.2.4" s.summary = "Powerful and modern progress HUD for iOS." s.homepage = "https://github.com/JonasGessner/JGProgressHUD" s.license = { :type => "MIT", :file => "LICENSE.txt" } s.author = "Jonas Gessner" s.social_media_url = "http://twitter.com/JonasGessner" s.platform = :ios, "5.0" - s.source = { :git => "https://github.com/JonasGessner/JGProgressHUD.git", :tag => "v1.2.3" } + s.source = { :git => "https://github.com/JonasGessner/JGProgressHUD.git", :tag => "v1.2.4" } s.source_files = "JGProgressHUD/JGProgressHUD/*.{h,m}" s.resources = "JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle" s.frameworks = "Foundation", "UIKit", "QuartzCore" diff --git a/JGProgressHUD/JGProgressHUD/JGProgressHUD.h b/JGProgressHUD/JGProgressHUD/JGProgressHUD.h index f778db2..b114f0c 100755 --- a/JGProgressHUD/JGProgressHUD/JGProgressHUD.h +++ b/JGProgressHUD/JGProgressHUD/JGProgressHUD.h @@ -252,12 +252,15 @@ typedef NS_ENUM(NSUInteger, JGProgressHUDInteractionType) { /** - Specify a minimum time that the HUD will be on-screen. Useful to prevent the HUD from flashing quickly on the screen when network operations complete more quickly than expected. + Specifies a minimum time that the HUD will be on-screen. Useful to prevent the HUD from flashing quickly on the screen when indeterminate tasks complete more quickly than expected. @b Default: 0.0. */ @property (nonatomic, assign) NSTimeInterval minimumDisplayTime; + + + ///////////// // Showing // ///////////// @@ -299,7 +302,6 @@ typedef NS_ENUM(NSUInteger, JGProgressHUDInteractionType) { //////////////// - /** Dismisses the HUD animated. */ diff --git a/JGProgressHUD/JGProgressHUD/JGProgressHUD.m b/JGProgressHUD/JGProgressHUD/JGProgressHUD.m index 4f020fd..6cf0aea 100755 --- a/JGProgressHUD/JGProgressHUD/JGProgressHUD.m +++ b/JGProgressHUD/JGProgressHUD/JGProgressHUD.m @@ -48,7 +48,7 @@ @interface JGProgressHUD () { BOOL _dismissAfterTransitionFinished; BOOL _dismissAfterTransitionFinishedWithAnimation; - CFAbsoluteTime _displayTime; + CFAbsoluteTime _displayTimestamp; JGProgressHUDIndicatorView *_indicatorViewAfterTransitioning; } @@ -338,7 +338,7 @@ - (void)cleanUpAfterPresentation { self.hidden = NO; _transitioning = NO; - _displayTime = CFAbsoluteTimeGetCurrent(); + _displayTimestamp = CFAbsoluteTimeGetCurrent(); //Correct timestamp to the current time for animated presentations if (_indicatorViewAfterTransitioning) { self.indicatorView = _indicatorViewAfterTransitioning; @@ -400,7 +400,7 @@ - (void)showInRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated { _transitioning = YES; - _displayTime = 0; + _displayTimestamp = CFAbsoluteTimeGetCurrent(); if ([self.delegate respondsToSelector:@selector(progressHUD:willPresentInView:)]) { [self.delegate progressHUD:self willPresentInView:view]; @@ -448,11 +448,14 @@ - (void)dismissAnimated:(BOOL)animated { return; } - if (self.minimumDisplayTime > 0 && _displayTime > 0) { - CFAbsoluteTime displayedTime = CFAbsoluteTimeGetCurrent() - _displayTime; + if (self.minimumDisplayTime > 0.0 && _displayTimestamp > 0.0) { + CFAbsoluteTime displayedTime = CFAbsoluteTimeGetCurrent()-_displayTimestamp; + if (displayedTime < self.minimumDisplayTime) { - NSTimeInterval delay = self.minimumDisplayTime - displayedTime; - [self dismissAfterDelay:delay animated:animated]; + NSTimeInterval delta = self.minimumDisplayTime-displayedTime; + + [self dismissAfterDelay:delta animated:animated]; + return; } } diff --git a/README.md b/README.md index be00413..8b37f40 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Overview
The JGProgressHUD Tests example project contains all kinds of different uses of JGProgressHUD. Check out the code and see how much JGProgressHUD can do!
-#####Current Version: 1.2.3 +#####Current Version: 1.2.4 ##Customization: @@ -113,8 +113,8 @@ Screenshots License ========== MIT License.
-©2014, Jonas Gessner. +© 2014-2015, Jonas Gessner. Credits ========== -Created by Jonas Gessner, ©2014.
+Created by Jonas Gessner, © 2014-2015.