Skip to content

Commit

Permalink
1.1.2
Browse files Browse the repository at this point in the history
• Added UIMotionEffect
• Updated tests
• Updated documentation (in JGProgressHUD.h)
  • Loading branch information
JonasGessner committed Aug 26, 2014
1 parent cd7db96 commit 65046d0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
10 changes: 9 additions & 1 deletion JGProgressHUD Tests/JGProgressHUD Tests/JGViewController.m
Expand Up @@ -79,6 +79,14 @@ - (void)simple:(NSUInteger)section {

[HUD showInView:self.navigationController.view];

UIView *HUDView = HUD->_HUDView;

HUDView.layer.shadowColor = [UIColor blackColor].CGColor;
HUDView.layer.shadowOffset = CGSizeZero;
HUDView.layer.shadowOpacity = 0.4f;
HUDView.layer.shadowRadius = 8.0f;
HUDView.layer.masksToBounds = NO;

[HUD dismissAfterDelay:3.0];
}

Expand Down Expand Up @@ -256,7 +264,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.accessoryView = nil;
switch (indexPath.row) {
case 0:
cell.textLabel.text = @"Fade, Activity Indicator";
cell.textLabel.text = @"Fade, Activity Indicator, Shadow";
break;
case 1:
cell.textLabel.text = @"Fade, Act. Ind. & Text, Transform";
Expand Down
4 changes: 2 additions & 2 deletions JGProgressHUD.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "JGProgressHUD"
s.version = "1.1.1"
s.version = "1.1.2"
s.summary = "Powerful and modern progress HUD for iOS."
s.description = <<-DESC
<b>JGProgressHUD:</b>
Expand All @@ -18,7 +18,7 @@ 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.1.1" }
s.source = { :git => "https://github.com/JonasGessner/JGProgressHUD.git", :tag => "v1.1.2" }
s.source_files = "JGProgressHUD/JGProgressHUD/*.{h,m}"
s.resources = "JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle"
s.frameworks = "Foundation", "UIKit", "QuartzCore"
Expand Down
2 changes: 1 addition & 1 deletion JGProgressHUD/JGProgressHUD/JGProgressHUD.h
Expand Up @@ -77,7 +77,7 @@ typedef NS_ENUM(NSUInteger, JGProgressHUDStyle) {
@interface JGProgressHUD : UIView {
@public
/**
On iOS 8 the getter -HUDView will return a UIVisualEffectView's contentView which is not comparable to the UIView returned on iOS < 8 because it is in a different place in the view hierarchy. If you need to directly access the absolute HUD view for animations you can get the real HUD view here.
On iOS 8 the getter -HUDView will return a UIVisualEffectView's contentView which is not comparable to the UIView returned on iOS < 8 because it is in a different place in the view hierarchy. If you need to directly access the absolute HUD view for animations or shadows you can get the real HUD view here. This value may be nil until `showInView:` or any other of the showing methods are called.
@sa JGProgressHUDFadeZoomAnimation
*/
UIView *_HUDView;
Expand Down
20 changes: 16 additions & 4 deletions JGProgressHUD/JGProgressHUD/JGProgressHUD.m
Expand Up @@ -109,7 +109,6 @@ - (instancetype)initWithStyle:(JGProgressHUDStyle)style {
_style = style;

self.hidden = YES;
self.opaque = NO;
self.backgroundColor = [UIColor clearColor];

self.contentInsets = UIEdgeInsetsMake(20.0f, 20.0f, 20.0f, 20.0f);
Expand Down Expand Up @@ -480,10 +479,24 @@ - (UIView *)HUDView {
else {
_HUDView.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.95f];
}

_HUDView.opaque = NO;
);

if (iOS7) {
UIInterpolatingMotionEffect *x = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];

CGFloat maxMovement = 25.0f;

x.minimumRelativeValue = @(-maxMovement);
x.maximumRelativeValue = @(maxMovement);

UIInterpolatingMotionEffect *y = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];

y.minimumRelativeValue = @(-maxMovement);
y.maximumRelativeValue = @(maxMovement);

_HUDView.motionEffects = @[x, y];
}

_HUDView.layer.cornerRadius = 10.0f;
_HUDView.layer.masksToBounds = YES;

Expand All @@ -501,7 +514,6 @@ - (UILabel *)textLabel {
if (!_textLabel) {
_textLabel = [[UILabel alloc] init];
_textLabel.backgroundColor = [UIColor clearColor];
_textLabel.opaque = NO;
_textLabel.textColor = (self.style == JGProgressHUDStyleDark ? [UIColor whiteColor] : [UIColor blackColor]);
_textLabel.textAlignment = NSTextAlignmentCenter;
_textLabel.font = [UIFont boldSystemFontOfSize:14.0f];
Expand Down
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -9,7 +9,7 @@ Simple but powerful and modern progress HUD for iOS.
<img src="JGProgressHUD Tests/Screenshots/6.png" width="18.9%" height="18.9%"/>&nbsp;
<img src="JGProgressHUD Tests/Screenshots/5.png" width="18.9%" height="18.9%"/>

#####Current Version: 1.1.1
#####Current Version: 1.1.2

Why use JGProgressHUD?
==================
Expand Down Expand Up @@ -56,7 +56,8 @@ To dim the content behind the HUD set your dim color as `backgroundColor` of you
Requirements
=================

• Deployment target and Base SDK of iOS 5 or higher.<br>
• Base SDK of iOS 7 or higher.<br>
• Deployment target of iOS 5 or higher.<br>
• ARC.

Documentation
Expand Down Expand Up @@ -110,9 +111,8 @@ An example of JGProgressHUD in a RubyMotion project can be found [here](https:/
License
==========
MIT License.<br>
©2014 Jonas Gessner.
©2014, Jonas Gessner.
Credits
==========
Created by Jonas Gessner © 2014.<br>
Inspired by HTProgressHUD and other open source progress HUD components.
Created by Jonas Gessner, ©2014.<br>

0 comments on commit 65046d0

Please sign in to comment.