diff --git a/Chatto/sources/ChatController/BaseChatViewController.swift b/Chatto/sources/ChatController/BaseChatViewController.swift index c1c5fa51..50e1c315 100644 --- a/Chatto/sources/ChatController/BaseChatViewController.swift +++ b/Chatto/sources/ChatController/BaseChatViewController.swift @@ -150,6 +150,10 @@ public final class BaseChatViewController: UIViewController { } override public func viewWillDisappear(_ animated: Bool) { + self.viewEventsHandlers.forEach { + $0.onBeforeViewWillDisappear() + } + super.viewWillDisappear(animated) self.keyboardUpdatesHandler.stopTracking() diff --git a/Chatto/sources/ChatController/InputBar/ChatInputBarPresenterProtocol.swift b/Chatto/sources/ChatController/InputBar/ChatInputBarPresenterProtocol.swift index 79a25d4c..3034fc66 100644 --- a/Chatto/sources/ChatController/InputBar/ChatInputBarPresenterProtocol.swift +++ b/Chatto/sources/ChatController/InputBar/ChatInputBarPresenterProtocol.swift @@ -51,6 +51,7 @@ public protocol ViewPresentationEventsHandling: AnyObject { func onViewWillAppear() func onViewDidAppear() + func onBeforeViewWillDisappear() func onViewWillDisappear() func onViewDidDisappear() func onViewDidLayoutSubviews()