From 6c27be621d329f0f2563e34dc58a14aad8f11ac1 Mon Sep 17 00:00:00 2001 From: Jens Daemgen Date: Thu, 26 Feb 2015 21:12:47 +0100 Subject: [PATCH] Add workaround for UIImagePickerController-bug which shows the statusBar * the statusBar shows up when the UIImagePickerController opens * the status bar does not disappear again when the UIImagePickerController is dismissed --- Classes/BITFeedbackComposeViewController.m | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Classes/BITFeedbackComposeViewController.m b/Classes/BITFeedbackComposeViewController.m index 9c6dab266e..7229f03781 100644 --- a/Classes/BITFeedbackComposeViewController.m +++ b/Classes/BITFeedbackComposeViewController.m @@ -67,6 +67,14 @@ @property (nonatomic) NSInteger selectedAttachmentIndex; @property (nonatomic, strong) UITapGestureRecognizer *tapRecognizer; +/** + * Workaround for UIImagePickerController bug. + * The statusBar shows up when the UIImagePickerController opens. + * 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; + @end @@ -275,7 +283,11 @@ if (_text && self.textView.text.length == 0) { self.textView.text = _text; } - + + if (self.statusBarHidden) { + [[UIApplication sharedApplication] setStatusBarHidden:self.statusBarHidden.boolValue]; + } + [self updateBarButtonState]; } @@ -464,7 +476,9 @@ - (void)addPhotoAction:(id)sender { if (_actionSheetVisible) return; - + + self.statusBarHidden = @([[UIApplication sharedApplication] isStatusBarHidden]); + // add photo. UIImagePickerController *pickerController = [[UIImagePickerController alloc] init]; pickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;