Skip to content

Commit

Permalink
Merge pull request #47 from mjwybrow/master
Browse files Browse the repository at this point in the history
Fix iPad rotation not being observed
  • Loading branch information
JonasGessner committed May 20, 2016
2 parents 572b90d + dac6dbf commit 0c8c48d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions JGProgressHUD/JGProgressHUD/JGProgressHUD.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@
@property (nonatomic, strong, readonly) UIView *contentView;

/**
The label used to present text on the HUD. set the @c text property of this label to change the displayed text. You may not change the label's @c frame or @c bounds.
The label used to present text on the HUD. Set the @c text property of this label to change the displayed text. You may not change the label's @c frame or @c bounds.
*/
@property (nonatomic, strong, readonly) UILabel *textLabel;

/**
The label used to present detail text on the HUD. set the @c text property of this label to change the displayed text. You may not change the label's @c frame or @c bounds.
The label used to present detail text on the HUD. Set the @c text property of this label to change the displayed text. You may not change the label's @c frame or @c bounds.
*/
@property (nonatomic, strong, readonly) UILabel *detailTextLabel;

Expand Down Expand Up @@ -227,15 +227,15 @@


/**
Shows the HUD animated. You should preferably show the HUD in a UIViewController's view.
Shows the HUD animated. You should preferably show the HUD in a UIViewController's view. The HUD will be repositioned in response to rotation and keyboard show/hide notifications.
@param view The view to show the HUD in. The frame of the @c view will be used to calculate the position of the HUD.
*/
- (void)showInView:(UIView *)view;

/**
Shows the HUD. You should preferably show the HUD in a UIViewController's view.
Shows the HUD. You should preferably show the HUD in a UIViewController's view. The HUD will be repositioned in response to rotation and keyboard show/hide notifications.
@param view The view to show the HUD in. The frame of the @c view will be used to calculate the position of the HUD.
@param animated If th HUD should show with an animation.
@param animated If the HUD should show with an animation.
*/
- (void)showInView:(UIView *)view animated:(BOOL)animated;

Expand All @@ -247,10 +247,10 @@
- (void)showInRect:(CGRect)rect inView:(UIView *)view;

/**
Shows the HUD animated. You should preferably show the HUD in a UIViewController's view.
Shows the HUD. You should preferably show the HUD in a UIViewController's view.
@param view The view to show the HUD in.
@param rect The rect allocated in @c view for displaying the HUD.
@param animated If th HUD should show with an animation.
@param animated If the HUD should show with an animation.
*/
- (void)showInRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated;

Expand Down
3 changes: 2 additions & 1 deletion JGProgressHUD/JGProgressHUD/JGProgressHUD.m
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ - (void)showInView:(UIView *)view {
- (void)showInView:(UIView *)view animated:(BOOL)animated {
CGRect frame = [self fullFrameInView:view];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged) name:UIDeviceOrientationDidChangeNotification object:nil];
// !!!: 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];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardFrameChanged:) name:UIKeyboardWillChangeFrameNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardFrameChanged:) name:UIKeyboardDidChangeFrameNotification object:nil];
Expand Down

0 comments on commit 0c8c48d

Please sign in to comment.