Skip to content

Commit

Permalink
[1.1]
Browse files Browse the repository at this point in the history
• Added success and error indicators
• Deprecated two properties (see JGProgressHUD.h for explanations)
• Added resources bundle, make sure to include this when you are using
the success or error indicator!
  • Loading branch information
JonasGessner committed Aug 19, 2014
1 parent dfd243e commit 76f703e
Show file tree
Hide file tree
Showing 16 changed files with 322 additions and 102 deletions.
46 changes: 30 additions & 16 deletions JGProgressHUD Tests/JGProgressHUD Tests.xcodeproj/project.pbxproj
Expand Up @@ -8,10 +8,7 @@

/* Begin PBXBuildFile section */
6B20E7D7197FC22E00488D60 /* libJGProgressHUD.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B20E7D4197FC22000488D60 /* libJGProgressHUD.a */; };
6B334B67197E78780010087F /* jg_hud_error.png in Resources */ = {isa = PBXBuildFile; fileRef = 6B334B63197E78780010087F /* jg_hud_error.png */; };
6B334B68197E78780010087F /* jg_hud_error@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6B334B64197E78780010087F /* jg_hud_error@2x.png */; };
6B334B69197E78780010087F /* jg_hud_success.png in Resources */ = {isa = PBXBuildFile; fileRef = 6B334B65197E78780010087F /* jg_hud_success.png */; };
6B334B6A197E78780010087F /* jg_hud_success@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6B334B66197E78780010087F /* jg_hud_success@2x.png */; };
6B60B26719A3C09900ED1A4E /* JGProgressHUD Resources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 6B60B24D19A3B41600ED1A4E /* JGProgressHUD Resources.bundle */; };
6BC018C8197BF28100DA4C49 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BC018C7197BF28100DA4C49 /* Foundation.framework */; };
6BC018CA197BF28100DA4C49 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BC018C9197BF28100DA4C49 /* CoreGraphics.framework */; };
6BC018CC197BF28100DA4C49 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BC018CB197BF28100DA4C49 /* UIKit.framework */; };
Expand All @@ -37,14 +34,24 @@
remoteGlobalIDString = 6BC01872197B2AA500DA4C49;
remoteInfo = JGProgressHUD;
};
6B60B24C19A3B41600ED1A4E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6B20E7CF197FC22000488D60 /* JGProgressHUD.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 6B60B24019A3B3C500ED1A4E;
remoteInfo = "JGProgressHUD Resources";
};
6B60B25019A3B6D600ED1A4E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6B20E7CF197FC22000488D60 /* JGProgressHUD.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 6B60B23F19A3B3C500ED1A4E;
remoteInfo = "JGProgressHUD Resources";
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
6B20E7CF197FC22000488D60 /* JGProgressHUD.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = JGProgressHUD.xcodeproj; path = ../../JGProgressHUD/JGProgressHUD.xcodeproj; sourceTree = "<group>"; };
6B334B63197E78780010087F /* jg_hud_error.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = jg_hud_error.png; sourceTree = "<group>"; };
6B334B64197E78780010087F /* jg_hud_error@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "jg_hud_error@2x.png"; sourceTree = "<group>"; };
6B334B65197E78780010087F /* jg_hud_success.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = jg_hud_success.png; sourceTree = "<group>"; };
6B334B66197E78780010087F /* jg_hud_success@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "jg_hud_success@2x.png"; sourceTree = "<group>"; };
6BC018C4197BF28100DA4C49 /* JGProgressHUD Tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "JGProgressHUD Tests.app"; sourceTree = BUILT_PRODUCTS_DIR; };
6BC018C7197BF28100DA4C49 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
6BC018C9197BF28100DA4C49 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -80,6 +87,7 @@
isa = PBXGroup;
children = (
6B20E7D4197FC22000488D60 /* libJGProgressHUD.a */,
6B60B24D19A3B41600ED1A4E /* JGProgressHUD Resources.bundle */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -119,10 +127,6 @@
6BC018D7197BF28100DA4C49 /* JGAppDelegate.m */,
6BC018DF197BF28100DA4C49 /* JGViewController.h */,
6BC018E0197BF28100DA4C49 /* JGViewController.m */,
6B334B63197E78780010087F /* jg_hud_error.png */,
6B334B64197E78780010087F /* jg_hud_error@2x.png */,
6B334B65197E78780010087F /* jg_hud_success.png */,
6B334B66197E78780010087F /* jg_hud_success@2x.png */,
6B20E7CF197FC22000488D60 /* JGProgressHUD.xcodeproj */,
6BC018E2197BF28100DA4C49 /* Images.xcassets */,
6BC018CE197BF28100DA4C49 /* Supporting Files */,
Expand Down Expand Up @@ -155,6 +159,7 @@
buildRules = (
);
dependencies = (
6B60B25119A3B6D600ED1A4E /* PBXTargetDependency */,
6B20E7D6197FC22A00488D60 /* PBXTargetDependency */,
);
name = "JGProgressHUD Tests";
Expand Down Expand Up @@ -204,6 +209,13 @@
remoteRef = 6B20E7D3197FC22000488D60 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
6B60B24D19A3B41600ED1A4E /* JGProgressHUD Resources.bundle */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = "JGProgressHUD Resources.bundle";
remoteRef = 6B60B24C19A3B41600ED1A4E /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
Expand All @@ -212,11 +224,8 @@
buildActionMask = 2147483647;
files = (
6BC018E3197BF28100DA4C49 /* Images.xcassets in Resources */,
6B334B6A197E78780010087F /* jg_hud_success@2x.png in Resources */,
6BC018D2197BF28100DA4C49 /* InfoPlist.strings in Resources */,
6B334B68197E78780010087F /* jg_hud_error@2x.png in Resources */,
6B334B69197E78780010087F /* jg_hud_success.png in Resources */,
6B334B67197E78780010087F /* jg_hud_error.png in Resources */,
6B60B26719A3C09900ED1A4E /* JGProgressHUD Resources.bundle in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -241,6 +250,11 @@
name = JGProgressHUD;
targetProxy = 6B20E7D5197FC22A00488D60 /* PBXContainerItemProxy */;
};
6B60B25119A3B6D600ED1A4E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "JGProgressHUD Resources";
targetProxy = 6B60B25019A3B6D600ED1A4E /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
Expand Down
20 changes: 8 additions & 12 deletions JGProgressHUD Tests/JGProgressHUD Tests/JGViewController.m
Expand Up @@ -11,6 +11,8 @@
#import "JGProgressHUDPieIndicatorView.h"
#import "JGProgressHUDRingIndicatorView.h"
#import "JGProgressHUDFadeZoomAnimation.h"
#import "JGProgressHUDSuccessIndicatorView.h"
#import "JGProgressHUDErrorIndicatorView.h"

@interface JGViewController () <JGProgressHUDDelegate> {
BOOL _blockUserInteraction;
Expand Down Expand Up @@ -46,11 +48,8 @@ - (void)success:(NSUInteger)section {
JGProgressHUD *HUD = [[JGProgressHUD alloc] initWithStyle:(JGProgressHUDStyle)section];
HUD.userInteractionEnabled = _blockUserInteraction;
HUD.delegate = self;

UIImageView *errorImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"jg_hud_success.png"]];
HUD.textLabel.text = @"Success!";
JGProgressHUDIndicatorView *ind = [[JGProgressHUDIndicatorView alloc] initWithContentView:errorImageView];
HUD.progressIndicatorView = ind;
HUD.indicatorView = [[JGProgressHUDSuccessIndicatorView alloc] init];

HUD.square = YES;

Expand All @@ -63,11 +62,8 @@ - (void)error:(NSUInteger)section {
JGProgressHUD *HUD = [[JGProgressHUD alloc] initWithStyle:(JGProgressHUDStyle)section];
HUD.userInteractionEnabled = _blockUserInteraction;
HUD.delegate = self;

UIImageView *errorImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"jg_hud_error.png"]];
HUD.textLabel.text = @"Error!";
JGProgressHUDIndicatorView *ind = [[JGProgressHUDIndicatorView alloc] initWithContentView:errorImageView];
HUD.progressIndicatorView = ind;
HUD.indicatorView = [[JGProgressHUDErrorIndicatorView alloc] init];

HUD.square = YES;

Expand All @@ -94,7 +90,7 @@ - (void)withText:(NSUInteger)section {
[HUD showInView:self.navigationController.view];

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
HUD.useProgressIndicatorView = NO;
HUD.indicatorView = nil;

HUD.textLabel.font = [UIFont systemFontOfSize:30.0f];

Expand All @@ -110,7 +106,7 @@ - (void)withText:(NSUInteger)section {

- (void)progress:(NSUInteger)section {
JGProgressHUD *HUD = [[JGProgressHUD alloc] initWithStyle:(JGProgressHUDStyle)section];
HUD.progressIndicatorView = [[JGProgressHUDPieIndicatorView alloc] initWithHUDStyle:HUD.style];
HUD.indicatorView = [[JGProgressHUDPieIndicatorView alloc] initWithHUDStyle:HUD.style];
HUD.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.4f];
HUD.delegate = self;
HUD.userInteractionEnabled = _blockUserInteraction;
Expand Down Expand Up @@ -140,7 +136,7 @@ - (void)progress:(NSUInteger)section {

- (void)zoomAnimationWithRing:(NSUInteger)section {
JGProgressHUD *HUD = [[JGProgressHUD alloc] initWithStyle:(JGProgressHUDStyle)section];
HUD.progressIndicatorView = [[JGProgressHUDRingIndicatorView alloc] initWithHUDStyle:HUD.style];
HUD.indicatorView = [[JGProgressHUDRingIndicatorView alloc] initWithHUDStyle:HUD.style];
HUD.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.4f];
HUD.userInteractionEnabled = _blockUserInteraction;
JGProgressHUDFadeZoomAnimation *an = [JGProgressHUDFadeZoomAnimation animation];
Expand Down Expand Up @@ -172,7 +168,7 @@ - (void)zoomAnimationWithRing:(NSUInteger)section {

- (void)textOnly:(NSUInteger)section {
JGProgressHUD *HUD = [[JGProgressHUD alloc] initWithStyle:(JGProgressHUDStyle)section];
HUD.useProgressIndicatorView = NO;
HUD.indicatorView = nil;
HUD.userInteractionEnabled = _blockUserInteraction;
HUD.textLabel.text = @"Hello, World!";
HUD.delegate = self;
Expand Down
7 changes: 4 additions & 3 deletions JGProgressHUD.podspec
@@ -1,12 +1,12 @@
Pod::Spec.new do |s|

s.name = "JGProgressHUD"
s.version = "1.0.4"
s.version = "1.1"
s.summary = "Simple but powerful and modern progress HUD for iOS."
s.description = <<-DESC
<b>JGProgressHUD:</b>
• Super simple to implement
• Feature rich
• Feature-rich
• Easy extensibility and customization (custom animations and progress indicators)
• Up to date, ex. using a blurred view on iOS 8
• Backwards compatibility to iOS 5
Expand All @@ -18,8 +18,9 @@ DESC
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.0.4" }
s.source = { :git => "https://github.com/JonasGessner/JGProgressHUD.git", :tag => "v1.1" }
s.source_files = "JGProgressHUD/JGProgressHUD/*.{h,m}"
s.resources = "JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle"
s.frameworks = "Foundation", "UIKit", "QuartzCore"
s.requires_arc = true

Expand Down

0 comments on commit 76f703e

Please sign in to comment.