Skip to content

Commit

Permalink
1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasGessner committed Apr 14, 2015
1 parent 6e9ff19 commit 0e4b37b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions 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"
Expand Down
6 changes: 4 additions & 2 deletions JGProgressHUD/JGProgressHUD/JGProgressHUD.h
Expand Up @@ -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 //
/////////////
Expand Down Expand Up @@ -299,7 +302,6 @@ typedef NS_ENUM(NSUInteger, JGProgressHUDInteractionType) {
////////////////



/**
Dismisses the HUD animated.
*/
Expand Down
17 changes: 10 additions & 7 deletions JGProgressHUD/JGProgressHUD/JGProgressHUD.m
Expand Up @@ -48,7 +48,7 @@ @interface JGProgressHUD () {
BOOL _dismissAfterTransitionFinished;
BOOL _dismissAfterTransitionFinishedWithAnimation;

CFAbsoluteTime _displayTime;
CFAbsoluteTime _displayTimestamp;

JGProgressHUDIndicatorView *_indicatorViewAfterTransitioning;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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;
}
}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -21,7 +21,7 @@ Overview
<br>
The <a href="JGProgressHUD%20Tests">JGProgressHUD Tests</a> example project contains all kinds of different uses of JGProgressHUD. Check out the code and see how much JGProgressHUD can do!
<br>
#####Current Version: 1.2.3
#####Current Version: 1.2.4

##Customization:

Expand Down Expand Up @@ -113,8 +113,8 @@ Screenshots
License
==========
MIT License.<br>
©2014, Jonas Gessner.
© 2014-2015, Jonas Gessner.
Credits
==========
Created by Jonas Gessner, ©2014.<br>
Created by Jonas Gessner, © 2014-2015.<br>

0 comments on commit 0e4b37b

Please sign in to comment.