Skip to content

Commit 2b83726

Browse files
committed
better support for dismissing into custom presentation controller
1 parent dde8261 commit 2b83726

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/Hero2/Base/Transition.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,13 @@ extension Transition: UIViewControllerAnimatedTransitioning {
216216
container.addSubview(backgroundView!)
217217
container.addSubview(foregroundView!)
218218
if automaticallyLayoutToView {
219-
toView!.frameWithoutTransform = container.frame
219+
if !isPresenting {
220+
toViewController?.presentationController?.containerViewWillLayoutSubviews()
221+
container.layoutSubviews()
222+
toViewController?.presentationController?.containerViewDidLayoutSubviews()
223+
} else {
224+
toView!.frameWithoutTransform = container.frame
225+
}
220226
toView!.layoutIfNeeded()
221227
}
222228

0 commit comments

Comments
 (0)