Permalink
Browse files

Moved initial setTransformForCurrentOrientation check to didMoveToSup…

…erview. fixes #102
  • Loading branch information...
matej committed Jan 29, 2013
1 parent 283cd62 commit 09284ec788276d2127fb077d7385d04468d34bb3
Showing with 10 additions and 6 deletions.
  1. +10 −6 MBProgressHUD.m
View
@@ -192,12 +192,7 @@ - (id)initWithFrame:(CGRect)frame {
- (id)initWithView:(UIView *)view {
NSAssert(view, @"View must not be nil.");
- id me = [self initWithFrame:view.bounds];
- // We need to take care of rotation ourselfs if we're adding the HUD to a window
- if ([view isKindOfClass:[UIWindow class]]) {
- [self setTransformForCurrentOrientation:NO];
- }
- return me;
+ return [self initWithFrame:view.bounds];
}
- (id)initWithWindow:(UIWindow *)window {
@@ -279,6 +274,15 @@ - (void)handleMinShowTimer:(NSTimer *)theTimer {
[self hideUsingAnimation:useAnimation];
}
+#pragma mark - View Hierrarchy
+
+- (void)didMoveToSuperview {
+ // We need to take care of rotation ourselfs if we're adding the HUD to a window
+ if ([self.superview isKindOfClass:[UIWindow class]]) {
+ [self setTransformForCurrentOrientation:NO];
+ }
+}
+
#pragma mark - Internal show & hide operations
- (void)showUsingAnimation:(BOOL)animated {

0 comments on commit 09284ec

Please sign in to comment.