From b933ac84e8fc0aa5e96e73190332f7a1a3b82992 Mon Sep 17 00:00:00 2001 From: macbaginski <79625096+macbaginski@users.noreply.github.com> Date: Tue, 30 Nov 2021 15:47:23 +0100 Subject: [PATCH] Fix contentViewContainer additionalSafeAreaInset Fix bottom additionalSafeAreaInset for controllers that use safeAreaLayout constraints. --- Sources/AKSideMenu/AKSideMenu.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/AKSideMenu/AKSideMenu.swift b/Sources/AKSideMenu/AKSideMenu.swift index 3d94e9d..57c9b8e 100644 --- a/Sources/AKSideMenu/AKSideMenu.swift +++ b/Sources/AKSideMenu/AKSideMenu.swift @@ -514,10 +514,11 @@ open class AKSideMenu: UIViewController, UIGestureRecognizerDelegate { } else if insets.top < .zero { insets.top = .zero } - let bottomSafeArea = self.view.safeAreaLayoutGuide.layoutFrame.maxY - if insets.bottom < bottomSafeArea { + insets.bottom = self.view.frame.maxY - self.contentViewContainer.frame.maxY + let bottomSafeArea = self.view.frame.maxY - self.view.safeAreaLayoutGuide.layoutFrame.maxY + if insets.bottom > bottomSafeArea { insets.bottom = bottomSafeArea - } else if insets.bottom <= bottomSafeArea { + } else if insets.bottom < .zero { insets.bottom = .zero } self.contentViewController?.additionalSafeAreaInsets = insets