Skip to content

Commit

Permalink
1.3
Browse files Browse the repository at this point in the history
• Added image indicator view
• Fixed carthage support

- Fixed #34 and #36
  • Loading branch information
JonasGessner committed Aug 5, 2015
1 parent 12d9c8e commit cacaa27
Show file tree
Hide file tree
Showing 46 changed files with 163 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>de.j-gessner.${PRODUCT_NAME:rfc1034identifier}</string>
<string>de.j-gessner.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ - (void)setShadow:(UISwitch *)s {
_shadow = s.on;
}


- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
if (section == 0) {
return @"Configure";
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion JGProgressHUD/JGProgressHUD Framework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>de.j-gessner.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
47 changes: 43 additions & 4 deletions JGProgressHUD/JGProgressHUD.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
6BC018B3197B2ABF00DA4C49 /* JGProgressHUDRingIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BC018AB197B2ABF00DA4C49 /* JGProgressHUDRingIndicatorView.m */; };
6BC018B7197B2BC700DA4C49 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BC018B6197B2BC700DA4C49 /* UIKit.framework */; };
6BC018B9197B2BCB00DA4C49 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BC018B8197B2BCB00DA4C49 /* QuartzCore.framework */; };
6BEEFF591B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BEEFF571B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.h */; settings = {ATTRIBUTES = (Public, ); }; };
6BEEFF5A1B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BEEFF581B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.m */; };
6BEEFF5B1B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BEEFF581B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.m */; };
6BEEFF5F1B7220AD006B4CD7 /* JGProgressHUDImageIndicatorView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 6BEEFF571B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.h */; };
6BF7DC4B1AEE6D39000A0AE0 /* JGProgressHUD.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 6BC0189C197B2ABF00DA4C49 /* JGProgressHUD.h */; };
6BF7DC4C1AEE6D39000A0AE0 /* JGProgressHUDAnimation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 6BC0189E197B2ABF00DA4C49 /* JGProgressHUDAnimation.h */; };
6BF7DC4D1AEE6D39000A0AE0 /* JGProgressHUDFadeAnimation.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 6BC018A0197B2ABF00DA4C49 /* JGProgressHUDFadeAnimation.h */; };
Expand Down Expand Up @@ -81,6 +85,7 @@
dstPath = include;
dstSubfolderSpec = 16;
files = (
6BEEFF5F1B7220AD006B4CD7 /* JGProgressHUDImageIndicatorView.h in Copy Headers */,
6BF7DC4B1AEE6D39000A0AE0 /* JGProgressHUD.h in Copy Headers */,
6BF7DC4C1AEE6D39000A0AE0 /* JGProgressHUDAnimation.h in Copy Headers */,
6BF7DC4D1AEE6D39000A0AE0 /* JGProgressHUDFadeAnimation.h in Copy Headers */,
Expand Down Expand Up @@ -132,6 +137,8 @@
6BC018B6197B2BC700DA4C49 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
6BC018B8197B2BCB00DA4C49 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
6BD009001991033600DE219C /* JGProgressHUD-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "JGProgressHUD-Prefix.pch"; sourceTree = SOURCE_ROOT; };
6BEEFF571B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JGProgressHUDImageIndicatorView.h; sourceTree = "<group>"; };
6BEEFF581B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JGProgressHUDImageIndicatorView.m; sourceTree = "<group>"; };
6BF7DC5A1AEFCFD9000A0AE0 /* JGProgressHUD.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JGProgressHUD.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6BF7DC5D1AEFCFD9000A0AE0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6BF7DC881AEFD063000A0AE0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -255,18 +262,44 @@
children = (
6BC018A6197B2ABF00DA4C49 /* JGProgressHUDIndicatorView.h */,
6BC018A7197B2ABF00DA4C49 /* JGProgressHUDIndicatorView.m */,
6BC018A4197B2ABF00DA4C49 /* JGProgressHUDIndeterminateIndicatorView.h */,
6BC018A5197B2ABF00DA4C49 /* JGProgressHUDIndeterminateIndicatorView.m */,
6BEEFF571B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.h */,
6BEEFF581B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.m */,
6BEEFF5E1B721FEE006B4CD7 /* Indeterminate Progress */,
6BEEFF5C1B721FD0006B4CD7 /* Progress Indicators */,
6BEEFF5D1B721FDB006B4CD7 /* Success/Error Indicators */,
);
name = Indicators;
sourceTree = "<group>";
};
6BEEFF5C1B721FD0006B4CD7 /* Progress Indicators */ = {
isa = PBXGroup;
children = (
6BC018A8197B2ABF00DA4C49 /* JGProgressHUDPieIndicatorView.h */,
6BC018A9197B2ABF00DA4C49 /* JGProgressHUDPieIndicatorView.m */,
6BC018AA197B2ABF00DA4C49 /* JGProgressHUDRingIndicatorView.h */,
6BC018AB197B2ABF00DA4C49 /* JGProgressHUDRingIndicatorView.m */,
);
name = "Progress Indicators";
sourceTree = "<group>";
};
6BEEFF5D1B721FDB006B4CD7 /* Success/Error Indicators */ = {
isa = PBXGroup;
children = (
6B60B25219A3B78B00ED1A4E /* JGProgressHUDSuccessIndicatorView.h */,
6B60B25319A3B78B00ED1A4E /* JGProgressHUDSuccessIndicatorView.m */,
6B60B25519A3BC3C00ED1A4E /* JGProgressHUDErrorIndicatorView.h */,
6B60B25619A3BC3C00ED1A4E /* JGProgressHUDErrorIndicatorView.m */,
);
name = Indicators;
name = "Success/Error Indicators";
sourceTree = "<group>";
};
6BEEFF5E1B721FEE006B4CD7 /* Indeterminate Progress */ = {
isa = PBXGroup;
children = (
6BC018A4197B2ABF00DA4C49 /* JGProgressHUDIndeterminateIndicatorView.h */,
6BC018A5197B2ABF00DA4C49 /* JGProgressHUDIndeterminateIndicatorView.m */,
);
name = "Indeterminate Progress";
sourceTree = "<group>";
};
6BF7DC5B1AEFCFD9000A0AE0 /* JGProgressHUD Framework */ = {
Expand Down Expand Up @@ -303,6 +336,7 @@
6BF7DC851AEFD045000A0AE0 /* JGProgressHUDSuccessIndicatorView.h in Headers */,
6BF7DC861AEFD045000A0AE0 /* JGProgressHUDErrorIndicatorView.h in Headers */,
6BF7DC931AEFD35D000A0AE0 /* JGProgressHUD-Defines.h in Headers */,
6BEEFF591B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -368,7 +402,7 @@
6BC0186B197B2AA500DA4C49 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "Jonas Gessner";
TargetAttributes = {
6B60B23F19A3B3C500ED1A4E = {
Expand Down Expand Up @@ -439,6 +473,7 @@
6BC018AC197B2ABF00DA4C49 /* JGProgressHUD.m in Sources */,
6BC018B2197B2ABF00DA4C49 /* JGProgressHUDPieIndicatorView.m in Sources */,
6BC018AF197B2ABF00DA4C49 /* JGProgressHUDFadeZoomAnimation.m in Sources */,
6BEEFF5A1B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.m in Sources */,
6BC018B3197B2ABF00DA4C49 /* JGProgressHUDRingIndicatorView.m in Sources */,
6BC018B0197B2ABF00DA4C49 /* JGProgressHUDIndeterminateIndicatorView.m in Sources */,
6BC018B1197B2ABF00DA4C49 /* JGProgressHUDIndicatorView.m in Sources */,
Expand All @@ -456,6 +491,7 @@
6BF7DC751AEFD02A000A0AE0 /* JGProgressHUDFadeAnimation.m in Sources */,
6BF7DC761AEFD02A000A0AE0 /* JGProgressHUDFadeZoomAnimation.m in Sources */,
6BF7DC771AEFD02A000A0AE0 /* JGProgressHUDIndicatorView.m in Sources */,
6BEEFF5B1B721ED0006B4CD7 /* JGProgressHUDImageIndicatorView.m in Sources */,
6BF7DC781AEFD02A000A0AE0 /* JGProgressHUDIndeterminateIndicatorView.m in Sources */,
6BF7DC791AEFD02A000A0AE0 /* JGProgressHUDPieIndicatorView.m in Sources */,
6BF7DC7A1AEFD02A000A0AE0 /* JGProgressHUDRingIndicatorView.m in Sources */,
Expand Down Expand Up @@ -529,6 +565,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -721,6 +758,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "de.j-gessner.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = JGProgressHUD;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -749,6 +787,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "de.j-gessner.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = JGProgressHUD;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -62,6 +62,8 @@
ReferencedContainer = "container:JGProgressHUD.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
Expand All @@ -71,6 +73,7 @@
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
Expand Down
17 changes: 4 additions & 13 deletions JGProgressHUD/JGProgressHUD/JGProgressHUD.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
*/
+ (instancetype)progressHUDWithStyle:(JGProgressHUDStyle)style;




/**
The view in which the HUD is presented.
*/
Expand Down Expand Up @@ -209,7 +212,6 @@
*/
- (void)setProgress:(float)progress animated:(BOOL)animated;


/**
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.
Expand All @@ -220,11 +222,6 @@



////////////////
// Presenting //
////////////////


/**
Shows the HUD animated. You should preferably show the HUD in a UIViewController's view.
@param view The view to show the HUD in. The frame of the @c view will be used to calculate the position of the HUD.
Expand Down Expand Up @@ -256,11 +253,6 @@



////////////////
// Dismissing //
////////////////


/**
Dismisses the HUD animated.
*/
Expand All @@ -285,11 +277,11 @@
*/
- (void)dismissAfterDelay:(NSTimeInterval)delay animated:(BOOL)animated;


@end




@interface JGProgressHUD (HUDManagement)

/**
Expand All @@ -298,7 +290,6 @@
*/
+ (NSArray *)allProgressHUDsInView:(UIView *)view;


/**
@param view The view to return all visible progress HUDs for.
@return All visible progress HUDs in the view and its subviews.
Expand Down
8 changes: 4 additions & 4 deletions JGProgressHUD/JGProgressHUD/JGProgressHUD.m
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ - (void)showInRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated {
}
}

#pragma mark - Hiding
#pragma mark - Dismissing

- (void)cleanUpAfterDismissal {
self.hidden = YES;
Expand Down Expand Up @@ -813,12 +813,13 @@ - (void)removeObservers {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardDidChangeFrameNotification object:nil];
}


@end

@implementation JGProgressHUD (HUDManagement)



@implementation JGProgressHUD (HUDManagement)

+ (NSArray *)allProgressHUDsInView:(UIView *)view {
NSMutableArray *HUDs = [NSMutableArray array];

Expand All @@ -831,7 +832,6 @@ + (NSArray *)allProgressHUDsInView:(UIView *)view {
return HUDs.copy;
}


+ (NSMutableArray *)_allProgressHUDsInViewHierarchy:(UIView *)view {
NSMutableArray *HUDs = [NSMutableArray array];

Expand Down
3 changes: 2 additions & 1 deletion JGProgressHUD/JGProgressHUD/JGProgressHUDAnimation.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
+ (instancetype)animation;




/**
The HUD which uses this animation.
*/
@property (nonatomic, weak, readonly) JGProgressHUD *progressHUD;


/**
The @c progressHUD is hidden from screen with @c alpha = 1 and @c hidden = @c YES. Ideally, you should prepare the HUD for presentation, then set @c hidden to @c NO on the @c progressHUD and then perform the animation.
@post Call @c animationFinished.
Expand Down
4 changes: 2 additions & 2 deletions JGProgressHUD/JGProgressHUD/JGProgressHUDErrorIndicatorView.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// Copyright (c) 2014 Jonas Gessner. All rights reserved.
//

#import "JGProgressHUDIndicatorView.h"
#import "JGProgressHUDImageIndicatorView.h"

@interface JGProgressHUDErrorIndicatorView : JGProgressHUDIndicatorView
@interface JGProgressHUDErrorIndicatorView : JGProgressHUDImageIndicatorView

/**
Default initializer for this class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ - (instancetype)initWithContentView:(UIView *__unused)contentView {

NSString *imgPath = [resourceBundle pathForResource:@"jg_hud_error" ofType:@"png"];

UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:imgPath]];

self = [super initWithContentView:imageView];
self = [super initWithImage:[UIImage imageWithContentsOfFile:imgPath]];

return self;
}
Expand Down
4 changes: 0 additions & 4 deletions JGProgressHUD/JGProgressHUD/JGProgressHUDFadeAnimation.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ - (void)setAnimationOptions:(UIViewAnimationOptions)animationOptions {
- (void)show {
[super show];

//Prepare animation
self.progressHUD.alpha = 0.0f;

//Now unhide HUD
self.progressHUD.hidden = NO;

//Perform the presentation animation
[UIView animateWithDuration:self.duration delay:0.0 options:self.animationOptions animations:^{
self.progressHUD.alpha = 1.0f;
} completion:^(BOOL __unused finished) {
Expand All @@ -50,7 +47,6 @@ - (void)show {
- (void)hide {
[super hide];

//Perform the dismissal animation
[UIView animateWithDuration:self.duration delay:0.0 options:self.animationOptions animations:^{
self.progressHUD.alpha = 0.0f;
} completion:^(BOOL __unused finished) {
Expand Down
7 changes: 0 additions & 7 deletions JGProgressHUD/JGProgressHUD/JGProgressHUDFadeZoomAnimation.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,13 @@ - (instancetype)init {
- (void)show {
[super show];

//Prepare the HUD
self.progressHUD.alpha = 0.0f;
self.progressHUD.HUDView.transform = CGAffineTransformMakeScale(0.1f, 0.1f);

NSTimeInterval totalDuration = self.expandAnimationDuaration+self.shrinkAnimationDuaration;

//Show the HUD
self.progressHUD.hidden = NO;


//Now animate the presentation
[UIView animateWithDuration:totalDuration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut) animations:^{
self.progressHUD.alpha = 1.0f;
} completion:nil];
Expand All @@ -61,7 +57,6 @@ - (void)hide {

NSTimeInterval totalDuration = self.expandAnimationDuaration+self.shrinkAnimationDuaration;

//Animate the dismissal
[UIView animateWithDuration:totalDuration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut) animations:^{
self.progressHUD.alpha = 0.0f;
} completion:nil];
Expand All @@ -72,10 +67,8 @@ - (void)hide {
[UIView animateWithDuration:self.shrinkAnimationDuaration delay:0.0 options:(UIViewAnimationOptions)(UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState) animations:^{
self.progressHUD.HUDView.transform = CGAffineTransformMakeScale(0.1f, 0.1f);
} completion:^(BOOL __unused __finished) {
//HUD is now hidden, restore the transform
self.progressHUD.HUDView.transform = CGAffineTransformIdentity;

//Alway call this last
[self animationFinished];
}];
}];
Expand Down
20 changes: 20 additions & 0 deletions JGProgressHUD/JGProgressHUD/JGProgressHUDImageIndicatorView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// JGProgressHUDImageIndicatorView.h
// JGProgressHUD
//
// Created by Jonas Gessner on 05.08.15.
// Copyright (c) 2015 Jonas Gessner. All rights reserved.
//

#import "JGProgressHUDIndicatorView.h"

@interface JGProgressHUDImageIndicatorView : JGProgressHUDIndicatorView

/**
Initializes the indicator view with an UIImageView showing the @c image.
@param image The image to show in the indicator view.
*/
- (instancetype)initWithImage:(UIImage *)image;

@end

0 comments on commit cacaa27

Please sign in to comment.