From 1ff3c28de8a0fe23264deb7a51e9861552e7e2be Mon Sep 17 00:00:00 2001 From: Shin Yamamoto Date: Mon, 13 Jun 2022 21:06:24 +0900 Subject: [PATCH] Ensure the initial state is hidden in presenting it as a modality (#551) --- Sources/Transitioning.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/Transitioning.swift b/Sources/Transitioning.swift index bb93321b..8b52141c 100644 --- a/Sources/Transitioning.swift +++ b/Sources/Transitioning.swift @@ -99,6 +99,9 @@ class ModalPresentTransition: NSObject, UIViewControllerAnimatedTransitioning { return animator } + // Ensure the current(initial) state is hidden. Because `fpc.transitionAnimator` can be nil if not. + fpc.move(to: .hidden, animated: false) + fpc.suspendTransitionAnimator(true) fpc.show(animated: true) { [weak fpc] in fpc?.suspendTransitionAnimator(false)