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.
* 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
@ -284,9 +284,11 @@
self.textView.text = _text;
}
if (self.statusBarHidden) {
[[UIApplication sharedApplication] setStatusBarHidden:self.statusBarHidden.boolValue];
if (self.isStatusBarHiddenBeforeShowingPhotoPicker) {
[[UIApplication sharedApplication] setStatusBarHidden:self.isStatusBarHiddenBeforeShowingPhotoPicker.boolValue];
}
self.isStatusBarHiddenBeforeShowingPhotoPicker = nil;
[self updateBarButtonState];
}
@ -477,7 +479,7 @@
- (void)addPhotoAction:(id)sender {
if (_actionSheetVisible) return;
self.statusBarHidden = @([[UIApplication sharedApplication] isStatusBarHidden]);
self.isStatusBarHiddenBeforeShowingPhotoPicker = @([[UIApplication sharedApplication] isStatusBarHidden]);
// add photo.
UIImagePickerController *pickerController = [[UIImagePickerController alloc] init];