diff --git a/Examples/JGProgressHUD Tests.xcodeproj/project.pbxproj b/Examples/JGProgressHUD Tests.xcodeproj/project.pbxproj index 6895270..0775518 100644 --- a/Examples/JGProgressHUD Tests.xcodeproj/project.pbxproj +++ b/Examples/JGProgressHUD Tests.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 6B0687591B776965002C584E /* JGProgressHUD.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6B0687511B77692F002C584E /* JGProgressHUD.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 6B1297821AF124BD00EECA97 /* JGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BC018D7197BF28100DA4C49 /* JGAppDelegate.m */; }; 6B1297831AF124BD00EECA97 /* JGViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BC018E0197BF28100DA4C49 /* JGViewController.m */; }; + 6B1EE4031D2FCEA6000C3CFD /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6B1EE4021D2FCEA6000C3CFD /* Launch Screen.storyboard */; }; 6B48F0D31AF12789006EDEB5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BC018D3197BF28100DA4C49 /* main.m */; }; 6B48F0DA1AF12991006EDEB5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6BC018E2197BF28100DA4C49 /* Images.xcassets */; }; 6B48F0DC1AF129A0006EDEB5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6BC018D0197BF28100DA4C49 /* InfoPlist.strings */; }; @@ -88,6 +89,7 @@ /* Begin PBXFileReference section */ 6B0687461B77692F002C584E /* JGProgressHUD.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = JGProgressHUD.xcodeproj; path = ../../JGProgressHUD.xcodeproj; sourceTree = ""; }; 6B1297541AF1245200EECA97 /* JGProgressHUD Tests - Framework.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "JGProgressHUD Tests - Framework.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 6B1EE4021D2FCEA6000C3CFD /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; 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; }; @@ -175,6 +177,7 @@ 6BC018DF197BF28100DA4C49 /* JGViewController.h */, 6BC018E0197BF28100DA4C49 /* JGViewController.m */, 6BC018E2197BF28100DA4C49 /* Images.xcassets */, + 6B1EE4021D2FCEA6000C3CFD /* Launch Screen.storyboard */, 6BC018CE197BF28100DA4C49 /* Supporting Files */, ); path = "JGProgressHUD Tests"; @@ -312,6 +315,7 @@ files = ( 6BC018E3197BF28100DA4C49 /* Images.xcassets in Resources */, 6BC018D2197BF28100DA4C49 /* InfoPlist.strings in Resources */, + 6B1EE4031D2FCEA6000C3CFD /* Launch Screen.storyboard in Resources */, 6B0687571B77695B002C584E /* JGProgressHUD Resources.bundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -375,7 +379,6 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_WARN_UNREACHABLE_CODE = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -399,7 +402,6 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_WARN_UNREACHABLE_CODE = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -500,7 +502,6 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "JGProgressHUD Tests/JGProgressHUD Tests-Prefix.pch"; INFOPLIST_FILE = "JGProgressHUD Tests/JGProgressHUD Tests-Info.plist"; @@ -518,7 +519,6 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "JGProgressHUD Tests/JGProgressHUD Tests-Prefix.pch"; INFOPLIST_FILE = "JGProgressHUD Tests/JGProgressHUD Tests-Info.plist"; diff --git a/Examples/JGProgressHUD Tests/Images.xcassets/AppIcon.appiconset/Contents.json b/Examples/JGProgressHUD Tests/Images.xcassets/AppIcon.appiconset/Contents.json index b10503e..cf98d29 100644 --- a/Examples/JGProgressHUD Tests/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Examples/JGProgressHUD Tests/Images.xcassets/AppIcon.appiconset/Contents.json @@ -94,6 +94,11 @@ "idiom" : "ipad", "size" : "76x76", "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" } ], "info" : { diff --git a/Examples/JGProgressHUD Tests/Images.xcassets/Contents.json b/Examples/JGProgressHUD Tests/Images.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Examples/JGProgressHUD Tests/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Contents.json b/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index f1a1488..0000000 --- a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "images" : [ - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "736h", - "filename" : "Default-736h@3x.png", - "minimum-system-version" : "8.0", - "orientation" : "portrait", - "scale" : "3x" - }, - { - "orientation" : "landscape", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "8.0", - "subtype" : "736h", - "scale" : "3x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "667h", - "filename" : "Default-667h@2x-1.png", - "minimum-system-version" : "8.0", - "orientation" : "portrait", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "filename" : "Default@2x Kopie.png", - "scale" : "2x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "retina4", - "filename" : "Default-568h@2x.png", - "minimum-system-version" : "7.0", - "orientation" : "portrait", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "filename" : "Default@2x.png", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "filename" : "Default-568h@2x Kopie.png", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-568h@2x Kopie.png b/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-568h@2x Kopie.png deleted file mode 100644 index 0891b7a..0000000 Binary files a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-568h@2x Kopie.png and /dev/null differ diff --git a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png deleted file mode 100644 index 0891b7a..0000000 Binary files a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png and /dev/null differ diff --git a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-667h@2x-1.png b/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-667h@2x-1.png deleted file mode 100644 index 85467c9..0000000 Binary files a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-667h@2x-1.png and /dev/null differ diff --git a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-736h@3x.png b/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-736h@3x.png deleted file mode 100644 index 83f92aa..0000000 Binary files a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default-736h@3x.png and /dev/null differ diff --git a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default@2x Kopie.png b/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default@2x Kopie.png deleted file mode 100644 index b1a0d95..0000000 Binary files a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default@2x Kopie.png and /dev/null differ diff --git a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default@2x.png b/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default@2x.png deleted file mode 100644 index b1a0d95..0000000 Binary files a/Examples/JGProgressHUD Tests/Images.xcassets/LaunchImage.launchimage/Default@2x.png and /dev/null differ diff --git a/Examples/JGProgressHUD Tests/JGProgressHUD Tests-Info.plist b/Examples/JGProgressHUD Tests/JGProgressHUD Tests-Info.plist index 7359188..06af0c8 100644 --- a/Examples/JGProgressHUD Tests/JGProgressHUD Tests-Info.plist +++ b/Examples/JGProgressHUD Tests/JGProgressHUD Tests-Info.plist @@ -24,6 +24,8 @@ 1.0 LSRequiresIPhoneOS + UILaunchStoryboardName + Launch Screen UIRequiredDeviceCapabilities armv7 diff --git a/Examples/JGProgressHUD Tests/JGViewController.m b/Examples/JGProgressHUD Tests/JGViewController.m index 028fdf5..0782db9 100644 --- a/Examples/JGProgressHUD Tests/JGViewController.m +++ b/Examples/JGProgressHUD Tests/JGViewController.m @@ -153,6 +153,13 @@ - (void)showCancellableHUD { sH.indicatorView = [[JGProgressHUDIndeterminateIndicatorView alloc] initWithHUDStyle:sH.style]; sH.textLabel.text = @"Loading very long..."; [h.HUDView.layer removeAnimationForKey:@"glow"]; + + if (_shadow) { + h.HUDView.layer.shadowColor = [UIColor blackColor].CGColor; + h.HUDView.layer.shadowOffset = CGSizeZero; + h.HUDView.layer.shadowOpacity = 0.4f; + h.HUDView.layer.shadowRadius = 8.0f; + } } }); } @@ -191,7 +198,7 @@ - (void)showNormalHUD { HUD.marginInsets = UIEdgeInsetsMake(0.0f, 0.0f, 10.0f, 0.0f); - [HUD dismissAfterDelay:3.0]; + [HUD dismissAfterDelay:4.0]; } - (void)showPieHUD { diff --git a/Examples/JGProgressHUD Tests/Launch Screen.storyboard b/Examples/JGProgressHUD Tests/Launch Screen.storyboard new file mode 100644 index 0000000..fb77f55 --- /dev/null +++ b/Examples/JGProgressHUD Tests/Launch Screen.storyboard @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JGProgressHUD.podspec b/JGProgressHUD.podspec index 34812d6..04cf2e3 100644 --- a/JGProgressHUD.podspec +++ b/JGProgressHUD.podspec @@ -1,14 +1,14 @@ Pod::Spec.new do |s| s.name = "JGProgressHUD" - s.version = "1.3.5" + s.version = "1.3.6" 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.5" } + s.source = { :git => "https://github.com/JonasGessner/JGProgressHUD.git", :tag => "v1.3.6" } 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.h b/JGProgressHUD/JGProgressHUD/JGProgressHUD.h index 01be0b9..e11dc69 100755 --- a/JGProgressHUD/JGProgressHUD/JGProgressHUD.h +++ b/JGProgressHUD/JGProgressHUD/JGProgressHUD.h @@ -200,7 +200,7 @@ @property (nonatomic, assign) NSTimeInterval layoutChangeAnimationDuration; /** - If the HUD is visible on screen. + @return Whether the HUD is visible on screen. */ @property (nonatomic, assign, readonly, getter = isVisible) BOOL visible; diff --git a/JGProgressHUD/JGProgressHUD/JGProgressHUD.m b/JGProgressHUD/JGProgressHUD/JGProgressHUD.m index 059b08f..d453800 100755 --- a/JGProgressHUD/JGProgressHUD/JGProgressHUD.m +++ b/JGProgressHUD/JGProgressHUD/JGProgressHUD.m @@ -48,13 +48,18 @@ @interface JGProgressHUD () { BOOL _dismissAfterTransitionFinished; BOOL _dismissAfterTransitionFinishedWithAnimation; + BOOL _observeTraitCollectionChange; + BOOL _presentingFull; + CFAbsoluteTime _displayTimestamp; JGProgressHUDIndicatorView *_indicatorViewAfterTransitioning; - UIView *_HUDViewHost; + UIView *_hostForActualHUDView; } +@property (nonatomic, strong, readonly) UIView *actualHUDView; + @end @interface JGProgressHUDAnimation (Private) @@ -66,6 +71,7 @@ @interface JGProgressHUDAnimation (Private) @implementation JGProgressHUD @synthesize HUDView = _HUDView; +@synthesize actualHUDView = _actualHUDView; @synthesize textLabel = _textLabel; @synthesize detailTextLabel = _detailTextLabel; @synthesize indicatorView = _indicatorView; @@ -118,6 +124,7 @@ - (instancetype)initWithStyle:(JGProgressHUDStyle)style { if (self) { _style = style; _voiceOverEnabled = YES; + _observeTraitCollectionChange = NO; self.hidden = YES; self.backgroundColor = [UIColor clearColor]; @@ -131,11 +138,15 @@ - (instancetype)initWithStyle:(JGProgressHUDStyle)style { _indicatorView = [[JGProgressHUDIndeterminateIndicatorView alloc] initWithHUDStyle:self.style]; - _HUDViewHost = [[UIView alloc] init]; - _HUDViewHost.backgroundColor = [UIColor clearColor]; - _HUDViewHost.clipsToBounds = YES; + _HUDView = [[UIView alloc] init]; + _HUDView.backgroundColor = [UIColor clearColor]; + + _hostForActualHUDView = [[UIView alloc] init]; + _hostForActualHUDView.backgroundColor = [UIColor clearColor]; + _hostForActualHUDView.clipsToBounds = YES; - [self addSubview:_HUDViewHost]; + [_HUDView addSubview:_hostForActualHUDView]; + [self addSubview:_HUDView]; self.cornerRadius = 10.0f; } @@ -205,8 +216,9 @@ - (void)setHUDViewFrameCenterWithSize:(CGSize)size { break; } - _HUDViewHost.frame = JGProgressHUD_CGRectIntegral(frame); - self.HUDView.frame = _HUDViewHost.bounds; + _HUDView.frame = JGProgressHUD_CGRectIntegral(frame); + _hostForActualHUDView.frame = _HUDView.bounds; + self.actualHUDView.frame = _hostForActualHUDView.bounds; } - (void)updateHUDAnimated:(BOOL)animated animateIndicatorViewFrame:(BOOL)animateIndicator { @@ -334,7 +346,23 @@ - (CGRect)fullFrameInView:(UIView *)view { } - (void)applyCornerRadius { - _HUDViewHost.layer.cornerRadius = self.cornerRadius; + _HUDView.layer.cornerRadius = self.cornerRadius; + _hostForActualHUDView.layer.cornerRadius = self.cornerRadius; +} + +- (void)traitCollectionDidChange:(__unused UITraitCollection *)previousTraitCollection { + if (_presentingFull && _observeTraitCollectionChange) { + [self updateFrame]; + } +} + +- (void)updateFrame { + if (self.targetView && !CGRectEqualToRect(self.bounds, self.targetView.bounds)) { + [UIView animateWithDuration:(iPad ? 0.4 : 0.3) delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{ + self.frame = [self fullFrameInView:self.targetView]; + [self updateHUDAnimated:NO animateIndicatorViewFrame:YES]; + } completion:nil]; + } } #pragma mark - Showing @@ -377,6 +405,8 @@ - (void)showInView:(UIView *)view { - (void)showInView:(UIView *)view animated:(BOOL)animated { CGRect frame = [self fullFrameInView:view]; + _presentingFull = YES; + // !!!: Use UIApplicationDidChangeStatusBarFrameNotification since UIDeviceOrientationDidChangeNotification still gives the old bounds in orientationChanged selector for self.targetView on iPad unless it is called after a delay. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged) name:UIApplicationDidChangeStatusBarFrameNotification object:nil]; @@ -409,6 +439,7 @@ - (void)showInRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated { [self updateHUDAnimated:NO animateIndicatorViewFrame:YES]; _transitioning = YES; + _observeTraitCollectionChange = YES; _displayTimestamp = CFAbsoluteTimeGetCurrent(); @@ -432,9 +463,11 @@ - (void)cleanUpAfterDismissal { [self removeObservers]; + _presentingFull = NO; _transitioning = NO; _dismissAfterTransitionFinished = NO; _dismissAfterTransitionFinishedWithAnimation = NO; + _observeTraitCollectionChange = NO; if ([self.delegate respondsToSelector:@selector(progressHUD:didDismissFromView:)]) { [self.delegate progressHUD:self didDismissFromView:self.targetView]; @@ -542,12 +575,7 @@ - (void)keyboardFrameChanged:(NSNotification *)notification { } - (void)orientationChanged { - if (self.targetView && !CGRectEqualToRect(self.bounds, self.targetView.bounds)) { - [UIView animateWithDuration:(iPad ? 0.4 : 0.3) delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseInOut animations:^{ - self.frame = [self fullFrameInView:self.targetView]; - [self updateHUDAnimated:NO animateIndicatorViewFrame:YES]; - } completion:nil]; - } + [self updateFrame]; } - (void)updateMotionOnHUDView { @@ -555,14 +583,14 @@ - (void)updateMotionOnHUDView { BOOL reduceMotionEnabled = (iOS8 && UIAccessibilityIsReduceMotionEnabled()); BOOL wantsParallax = ((self.parallaxMode == JGProgressHUDParallaxModeDevice && !reduceMotionEnabled) || self.parallaxMode == JGProgressHUDParallaxModeAlwaysOn); - BOOL hasParallax = (_HUDViewHost.motionEffects.count > 0); + BOOL hasParallax = (_HUDView.motionEffects.count > 0); if (wantsParallax == hasParallax) { return; } if (!wantsParallax) { - _HUDViewHost.motionEffects = @[]; + _HUDView.motionEffects = @[]; } else { UIInterpolatingMotionEffect *x = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis]; @@ -577,7 +605,7 @@ - (void)updateMotionOnHUDView { y.minimumRelativeValue = @(-maxMovement); y.maximumRelativeValue = @(maxMovement); - _HUDViewHost.motionEffects = @[x, y]; + _HUDView.motionEffects = @[x, y]; } } } @@ -597,8 +625,8 @@ - (BOOL)isVisible { return (self.superview != nil); } -- (UIView *)HUDView { - if (!_HUDView) { +- (UIView *)actualHUDView { + if (!_actualHUDView) { if (iOS8) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateMotionOnHUDView) name:UIAccessibilityReduceMotionStatusDidChangeNotification object:nil]; @@ -616,25 +644,25 @@ - (UIView *)HUDView { UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:effect]; - _HUDView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; + _actualHUDView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; } else { - _HUDView = [[UIView alloc] init]; + _actualHUDView = [[UIView alloc] init]; if (self.style == JGProgressHUDStyleDark) { - _HUDView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.8f]; + _actualHUDView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.8f]; } else if (self.style == JGProgressHUDStyleLight) { - _HUDView.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.75f]; + _actualHUDView.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.75f]; } else { - _HUDView.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.95f]; + _actualHUDView.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.95f]; } } [self updateMotionOnHUDView]; - [_HUDViewHost addSubview:_HUDView]; + [_hostForActualHUDView addSubview:_actualHUDView]; if (self.indicatorView) { [self.contentView addSubview:self.indicatorView]; @@ -643,15 +671,15 @@ - (UIView *)HUDView { [self.contentView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)]]; } - return _HUDView; + return _actualHUDView; } - (UIView *)contentView { if (iOS8) { - return ((UIVisualEffectView *)self.HUDView).contentView; + return ((UIVisualEffectView *)self.actualHUDView).contentView; } else { - return self.HUDView; + return self.actualHUDView; } }