Ensure attachment approval becomes first responder if app returns from background.

pull/2/head
Matthew Chen 6 years ago
parent f9445359d9
commit a48c3d8d20

@ -61,6 +61,15 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
options: [UIPageViewControllerOptionInterPageSpacingKey: kSpacingBetweenItems])
self.dataSource = self
self.delegate = self
NotificationCenter.default.addObserver(self,
selector: #selector(didBecomeActive),
name: NSNotification.Name.OWSApplicationDidBecomeActive,
object: nil)
}
deinit {
NotificationCenter.default.removeObserver(self)
}
@objc
@ -79,6 +88,14 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
return navController
}
// MARK: - Notifications
@objc func didBecomeActive() {
AssertIsOnMainThread()
updateContents()
}
// MARK: - Subviews
var galleryRailView: GalleryRailView {
@ -158,8 +175,8 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
private func updateContents() {
updateNavigationBar()
updateControlVisibility()
updateInputAccessory()
updateControlVisibility()
}
// MARK: - Input Accessory

Loading…
Cancel
Save