mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
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
This commit is contained in:
committed by
Andreas Linde
parent
3568b4cc1a
commit
6c27be621d
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user