Skip to content

Commit

Permalink
Fix contentViewContainer additionalSafeAreaInset
Browse files Browse the repository at this point in the history
Fix bottom additionalSafeAreaInset for controllers that use safeAreaLayout constraints.
  • Loading branch information
macbaginski authored Nov 30, 2021
1 parent 2e022b6 commit b933ac8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Sources/AKSideMenu/AKSideMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b933ac8

Please sign in to comment.