From 1bf88ca95e826e996bb37a9b1d480b9cb1e88f27 Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 29 Jun 2017 17:23:57 +0200 Subject: [PATCH] Bug report: Fix a crash when rotating + debackgrounding the app (#1362) --- Riot/ViewController/BugReportViewController.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Riot/ViewController/BugReportViewController.m b/Riot/ViewController/BugReportViewController.m index e1eacfe208..a69bb7d0b2 100644 --- a/Riot/ViewController/BugReportViewController.m +++ b/Riot/ViewController/BugReportViewController.m @@ -127,6 +127,8 @@ -(void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; + [self dismissKeyboard]; + if (screenShotFile) { [[NSFileManager defaultManager] removeItemAtURL:screenShotFile error:nil]; @@ -161,6 +163,12 @@ - (void)setSendScreenshot:(BOOL)sendScreenshot } #pragma mark - MXKViewController +- (void)dismissKeyboard +{ + // Hide the keyboard + [_bugReportDescriptionTextView resignFirstResponder]; +} + - (void)onKeyboardShowAnimationComplete { self.keyboardView = _bugReportDescriptionTextView.inputAccessoryView.superview;