diff --git a/JGProgressHUD.podspec b/JGProgressHUD.podspec index 2e516ec..34812d6 100644 --- a/JGProgressHUD.podspec +++ b/JGProgressHUD.podspec @@ -1,14 +1,14 @@ Pod::Spec.new do |s| s.name = "JGProgressHUD" - s.version = "1.3.4" + s.version = "1.3.5" 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, "6.0" - s.source = { :git => "https://github.com/JonasGessner/JGProgressHUD.git", :tag => "v1.3.4" } + s.source = { :git => "https://github.com/JonasGessner/JGProgressHUD.git", :tag => "v1.3.5" } s.source_files = "JGProgressHUD/JGProgressHUD/*.{h,m}" s.resource = "JGProgressHUD/JGProgressHUD/JGProgressHUD Resources.bundle" s.frameworks = "Foundation", "UIKit", "QuartzCore" diff --git a/JGProgressHUD/JGProgressHUD/JGProgressHUD-Defines.h b/JGProgressHUD/JGProgressHUD/JGProgressHUD-Defines.h index 00bb88e..145f164 100644 --- a/JGProgressHUD/JGProgressHUD/JGProgressHUD-Defines.h +++ b/JGProgressHUD/JGProgressHUD/JGProgressHUD-Defines.h @@ -60,9 +60,9 @@ typedef NS_ENUM(NSUInteger, JGProgressHUDInteractionType) { Parallax Modes. */ typedef NS_ENUM(NSUInteger, JGProgressHUDParallaxMode) { - /** Follows the device setting for parallax. If "Reduce Motion" is enabled, no parallax effect is added to the HUD, if "Reduce Motion" is disabled the HUD will have a parallax effect. */ + /** Follows the device setting for parallax. If "Reduce Motion" is enabled, no parallax effect is added to the HUD, if "Reduce Motion" is disabled the HUD will have a parallax effect. This behaviour is only supported on iOS 8 and higher. */ JGProgressHUDParallaxModeDevice = 0, - /** Always adds a parallax effect to the HUD. */ + /** Always adds a parallax effect to the HUD. Parallax is only supported on iOS 7 and higher. */ JGProgressHUDParallaxModeAlwaysOn, /** Never adds a parallax effect to the HUD. */ JGProgressHUDParallaxModeAlwaysOff diff --git a/JGProgressHUD/JGProgressHUD/JGProgressHUD.m b/JGProgressHUD/JGProgressHUD/JGProgressHUD.m index 94c4547..059b08f 100755 --- a/JGProgressHUD/JGProgressHUD/JGProgressHUD.m +++ b/JGProgressHUD/JGProgressHUD/JGProgressHUD.m @@ -552,7 +552,9 @@ - (void)orientationChanged { - (void)updateMotionOnHUDView { if (iOS7) { - BOOL wantsParallax = ((self.parallaxMode == JGProgressHUDParallaxModeDevice && !UIAccessibilityIsReduceMotionEnabled()) || self.parallaxMode == JGProgressHUDParallaxModeAlwaysOn); + BOOL reduceMotionEnabled = (iOS8 && UIAccessibilityIsReduceMotionEnabled()); + + BOOL wantsParallax = ((self.parallaxMode == JGProgressHUDParallaxModeDevice && !reduceMotionEnabled) || self.parallaxMode == JGProgressHUDParallaxModeAlwaysOn); BOOL hasParallax = (_HUDViewHost.motionEffects.count > 0); if (wantsParallax == hasParallax) { @@ -597,11 +599,9 @@ - (BOOL)isVisible { - (UIView *)HUDView { if (!_HUDView) { - if (iOS7) { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateMotionOnHUDView) name:UIAccessibilityReduceMotionStatusDidChangeNotification object:nil]; - } - if (iOS8) { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateMotionOnHUDView) name:UIAccessibilityReduceMotionStatusDidChangeNotification object:nil]; + UIBlurEffectStyle effect = 0; if (self.style == JGProgressHUDStyleDark) { @@ -846,7 +846,9 @@ - (void)dealloc { } - (void)removeObservers { - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIAccessibilityReduceMotionStatusDidChangeNotification object:nil]; + if (iOS8) { + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIAccessibilityReduceMotionStatusDidChangeNotification object:nil]; + } [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidChangeStatusBarFrameNotification object:nil];