Merge pull request #3557 from vector-im/element_3556

Gracefully cancel verification on iOS 13 drag gesture
This commit is contained in:
ismailgulek 2020-08-24 19:08:21 +03:00 committed by GitHub
commit e27f735f7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -15,6 +15,7 @@ Bugfix:
* Avoid email validation link to redirect to web app (#3513).
* Wait for first sync complete before stopping loading screen (#3336).
* Disable key backup on extensions (#3371).
* Gracefully cancel verification on iOS 13 drag gesture (#3556).
API Change:
*

View file

@ -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)
}
}
}