From 5831743aa9100eced0886d2ab9ed1db6b3b6b65b Mon Sep 17 00:00:00 2001 From: Ruslan Kavetsky Date: Thu, 29 Sep 2022 16:33:44 +0800 Subject: [PATCH] Improve fix for interactive dismiss cancellation bug --- .../Core/Presentation/BottomSheetPresentationController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/BottomSheet/Core/Presentation/BottomSheetPresentationController.swift b/Sources/BottomSheet/Core/Presentation/BottomSheetPresentationController.swift index 32a2355..9d81b40 100644 --- a/Sources/BottomSheet/Core/Presentation/BottomSheetPresentationController.swift +++ b/Sources/BottomSheet/Core/Presentation/BottomSheetPresentationController.swift @@ -535,8 +535,10 @@ extension BottomSheetPresentationController: UIViewControllerAnimatedTransitioni let completion = { (completed: Bool) in transitionContext.completeTransition(completed && !transitionContext.transitionWasCancelled) // For fix bug: https://openradar.appspot.com/FB9075949 - if transitionContext.transitionWasCancelled { + if #available(iOS 13, *), transitionContext.transitionWasCancelled { + let sourceViewFrame = sourceView.frame sourceView.frame = .zero + sourceView.frame = sourceViewFrame } }