Skip to content

Commit 09284ec

Browse files
committed
Moved initial setTransformForCurrentOrientation check to didMoveToSuperview. fixes jdg#102
1 parent 283cd62 commit 09284ec

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

MBProgressHUD.m

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,7 @@ - (id)initWithFrame:(CGRect)frame {
192192

193193
- (id)initWithView:(UIView *)view {
194194
NSAssert(view, @"View must not be nil.");
195-
id me = [self initWithFrame:view.bounds];
196-
// We need to take care of rotation ourselfs if we're adding the HUD to a window
197-
if ([view isKindOfClass:[UIWindow class]]) {
198-
[self setTransformForCurrentOrientation:NO];
199-
}
200-
return me;
195+
return [self initWithFrame:view.bounds];
201196
}
202197

203198
- (id)initWithWindow:(UIWindow *)window {
@@ -279,6 +274,15 @@ - (void)handleMinShowTimer:(NSTimer *)theTimer {
279274
[self hideUsingAnimation:useAnimation];
280275
}
281276

277+
#pragma mark - View Hierrarchy
278+
279+
- (void)didMoveToSuperview {
280+
// We need to take care of rotation ourselfs if we're adding the HUD to a window
281+
if ([self.superview isKindOfClass:[UIWindow class]]) {
282+
[self setTransformForCurrentOrientation:NO];
283+
}
284+
}
285+
282286
#pragma mark - Internal show & hide operations
283287

284288
- (void)showUsingAnimation:(BOOL)animated {

0 commit comments

Comments
 (0)