Skip to content

Commit f316d24

Browse files
committed
Merge pull request jdg#243 from epacces/fix/ios8/hudorientation
Fix/ios8/hudorientation
2 parents fc1903f + f4aaad3 commit f316d24

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

MBProgressHUD.m

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
#define kCFCoreFoundationVersionNumber_iOS_8_0 1129.15
4949
#endif
5050

51+
#ifndef __IPHONE_8_0
52+
#define __IPHONE_8_0 80000
53+
#endif
54+
5155

5256
static const CGFloat kPadding = 4.f;
5357
static const CGFloat kLabelFontSize = 16.f;
@@ -300,11 +304,20 @@ - (void)handleMinShowTimer:(NSTimer *)theTimer {
300304
#pragma mark - View Hierrarchy
301305

302306
- (BOOL)shouldPerformOrientationTransform {
303-
BOOL isPreiOS8 = NSFoundationVersionNumber < kCFCoreFoundationVersionNumber_iOS_8_0;
304-
// prior to iOS8 code needs to take care of rotation if it is being added to the window
305-
return isPreiOS8 && [self.superview isKindOfClass:[UIWindow class]];
307+
308+
#if (__IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_8_0)
309+
static BOOL isPreiOS8SDK = YES;
310+
#else
311+
static BOOL isPreiOS8SDK = NO;
312+
#endif
313+
314+
BOOL isPreiOS8 = NSFoundationVersionNumber < kCFCoreFoundationVersionNumber_iOS_8_0;
315+
BOOL transformationRequired = isPreiOS8 || isPreiOS8SDK;
316+
317+
return transformationRequired && [self.superview isKindOfClass:[UIWindow class]];
306318
}
307319

320+
308321
- (void)didMoveToSuperview {
309322
if ([self shouldPerformOrientationTransform]) {
310323
[self setTransformForCurrentOrientation:NO];

0 commit comments

Comments
 (0)