Minor changes to previous commit

- Change property name to be more explicit
- Reset proptery to nil, so we can are making sure the logic always works safely and is only triggered before the photo picker is invoked
This commit is contained in:
Andreas Linde 2015-03-26 17:07:26 +01:00
parent 6c27be621d
commit e74a495410

View File

@ -73,7 +73,7 @@
* The status bar does not disappear again when the UIImagePickerController is dismissed. * The status bar does not disappear again when the UIImagePickerController is dismissed.
* Therefore store the state when UIImagePickerController is shown and restore when viewWillAppear gets called. * Therefore store the state when UIImagePickerController is shown and restore when viewWillAppear gets called.
*/ */
@property (nonatomic, strong) NSNumber *statusBarHidden; @property (nonatomic, strong) NSNumber *isStatusBarHiddenBeforeShowingPhotoPicker;
@end @end
@ -284,10 +284,12 @@
self.textView.text = _text; self.textView.text = _text;
} }
if (self.statusBarHidden) { if (self.isStatusBarHiddenBeforeShowingPhotoPicker) {
[[UIApplication sharedApplication] setStatusBarHidden:self.statusBarHidden.boolValue]; [[UIApplication sharedApplication] setStatusBarHidden:self.isStatusBarHiddenBeforeShowingPhotoPicker.boolValue];
} }
self.isStatusBarHiddenBeforeShowingPhotoPicker = nil;
[self updateBarButtonState]; [self updateBarButtonState];
} }
@ -477,7 +479,7 @@
- (void)addPhotoAction:(id)sender { - (void)addPhotoAction:(id)sender {
if (_actionSheetVisible) return; if (_actionSheetVisible) return;
self.statusBarHidden = @([[UIApplication sharedApplication] isStatusBarHidden]); self.isStatusBarHiddenBeforeShowingPhotoPicker = @([[UIApplication sharedApplication] isStatusBarHidden]);
// add photo. // add photo.
UIImagePickerController *pickerController = [[UIImagePickerController alloc] init]; UIImagePickerController *pickerController = [[UIImagePickerController alloc] init];