diff --git a/JGProgressHUD Tests/JGProgressHUD Tests/JGViewController.m b/JGProgressHUD Tests/JGProgressHUD Tests/JGViewController.m index ff08048..a75e973 100644 --- a/JGProgressHUD Tests/JGProgressHUD Tests/JGViewController.m +++ b/JGProgressHUD Tests/JGProgressHUD Tests/JGViewController.m @@ -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]; } @@ -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"; diff --git a/JGProgressHUD.podspec b/JGProgressHUD.podspec index 013c197..ca71a28 100644 --- a/JGProgressHUD.podspec +++ b/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 JGProgressHUD: @@ -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" diff --git a/JGProgressHUD/JGProgressHUD/JGProgressHUD.h b/JGProgressHUD/JGProgressHUD/JGProgressHUD.h index 0ac32f6..7d2f916 100755 --- a/JGProgressHUD/JGProgressHUD/JGProgressHUD.h +++ b/JGProgressHUD/JGProgressHUD/JGProgressHUD.h @@ -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; diff --git a/JGProgressHUD/JGProgressHUD/JGProgressHUD.m b/JGProgressHUD/JGProgressHUD/JGProgressHUD.m index 3748f05..417eec3 100755 --- a/JGProgressHUD/JGProgressHUD/JGProgressHUD.m +++ b/JGProgressHUD/JGProgressHUD/JGProgressHUD.m @@ -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); @@ -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; @@ -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]; diff --git a/README.md b/README.md index 0e2453c..eecdb36 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Simple but powerful and modern progress HUD for iOS.   -#####Current Version: 1.1.1 +#####Current Version: 1.1.2 Why use JGProgressHUD? ================== @@ -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.
+• Base SDK of iOS 7 or higher.
+• Deployment target of iOS 5 or higher.
• ARC. Documentation @@ -110,9 +111,8 @@ An example of JGProgressHUD in a RubyMotion project can be found [here](https:/ License ========== MIT License.
-©2014 Jonas Gessner. +©2014, Jonas Gessner. Credits ========== -Created by Jonas Gessner © 2014.
-Inspired by HTProgressHUD and other open source progress HUD components. +Created by Jonas Gessner, ©2014.