From 877cc892e2ab6deb50ea55d7daba2f9e4891b331 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Thu, 20 Aug 2020 16:57:58 +0300 Subject: [PATCH 1/2] Add presentationController delegate --- ...KeyVerificationCoordinatorBridgePresenter.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Riot/Modules/KeyVerification/Common/KeyVerificationCoordinatorBridgePresenter.swift b/Riot/Modules/KeyVerification/Common/KeyVerificationCoordinatorBridgePresenter.swift index 3b9e9fac3..52e7e932e 100644 --- a/Riot/Modules/KeyVerification/Common/KeyVerificationCoordinatorBridgePresenter.swift +++ b/Riot/Modules/KeyVerification/Common/KeyVerificationCoordinatorBridgePresenter.swift @@ -128,7 +128,9 @@ final class KeyVerificationCoordinatorBridgePresenter: NSObject { private func present(coordinator keyVerificationCoordinator: KeyVerificationCoordinator, from viewController: UIViewController, animated: Bool) { keyVerificationCoordinator.delegate = self - viewController.present(keyVerificationCoordinator.toPresentable(), animated: animated, completion: nil) + let presentable = keyVerificationCoordinator.toPresentable() + presentable.presentationController?.delegate = self + viewController.present(presentable, animated: animated, completion: nil) keyVerificationCoordinator.start() self.coordinator = keyVerificationCoordinator @@ -146,3 +148,13 @@ extension KeyVerificationCoordinatorBridgePresenter: KeyVerificationCoordinatorD self.delegate?.keyVerificationCoordinatorBridgePresenterDelegateDidCancel(self) } } + +extension KeyVerificationCoordinatorBridgePresenter: UIAdaptivePresentationControllerDelegate { + + func presentationControllerDidDismiss(_ presentationController: UIPresentationController) { + if let coordinator = self.coordinator { + keyVerificationCoordinatorDidCancel(coordinator) + } + } + +} From 1d9ac0d6e0320ca5f19250dfd65a38f6ce22044c Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Thu, 20 Aug 2020 16:58:47 +0300 Subject: [PATCH 2/2] Update CHANGES.rst --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index 9b384bf25..8e8e5fd4c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -13,6 +13,7 @@ Improvements: Bugfix: * Fix biometry name null case (#3551). * Avoid email validation link to redirect to web app (#3513). + * Gracefully cancel verification on iOS 13 drag gesture (#3556). API Change: *