diff --git a/Sources/TGCardViewController/TGCardViewController.swift b/Sources/TGCardViewController/TGCardViewController.swift index 4441e8a..9ea0044 100644 --- a/Sources/TGCardViewController/TGCardViewController.swift +++ b/Sources/TGCardViewController/TGCardViewController.swift @@ -607,12 +607,12 @@ open class TGCardViewController: UIViewController { // Add it a bit of extra space around the switch-over to still detect // same position after hiding/showing bars - let peakMargin = peakY - 44 - let collapsedMargin = collapsedMinY - 44 + let peakMargin = max(extendedMinY, peakY - 44) + let collapsedMargin = max(peakY, collapsedMinY - 44) switch (cardY, traitCollection.verticalSizeClass) { - case (0.. 0 { - value += Constants.minMapSpaceWithHomeIndicator - } else if mode == .floating { - value += Constants.minMapSpace + if mode == .floating { + let bottomMinSpace = view.safeAreaInsets.bottom > 0 ? Constants.minMapSpaceWithHomeIndicator : Constants.minMapSpace + value += bottomMinSpace } return value