From c2c689ca9129bfeca72bf209473b62856901a46f Mon Sep 17 00:00:00 2001 From: Levitating Pineapple Date: Mon, 7 Oct 2024 21:24:07 +0300 Subject: [PATCH] fix animator crash --- apps/ios/Shared/Views/Helpers/SheetRepresentable.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/ios/Shared/Views/Helpers/SheetRepresentable.swift b/apps/ios/Shared/Views/Helpers/SheetRepresentable.swift index 580e8e940d..841d5c7eda 100644 --- a/apps/ios/Shared/Views/Helpers/SheetRepresentable.swift +++ b/apps/ios/Shared/Views/Helpers/SheetRepresentable.swift @@ -62,6 +62,11 @@ struct SheetRepresentable: UIViewControllerRepresentable { @available(*, unavailable) required init?(coder: NSCoder) { fatalError("init(coder:) missing") } + deinit { + animator.stopAnimation(true) + animator.finishAnimation(at: .current) + } + func animate(isPresented: Bool) { let alreadyAnimating = animator.isRunning && isPresented != animator.isReversed let sheetFullyDismissed = animator.fractionComplete == (animator.isReversed ? 1 : 0)