From b77e8ac814a1014d780bd8f652edacd3fdc758c9 Mon Sep 17 00:00:00 2001 From: Fabian Geistert Date: Fri, 22 Apr 2022 16:20:10 +0200 Subject: [PATCH] bugfix: respect UITabBarController for UINavigationController wrapped UIViewController --- Sources/Loaf/Presenter/Controller.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/Loaf/Presenter/Controller.swift b/Sources/Loaf/Presenter/Controller.swift index 8ed470a..080618f 100644 --- a/Sources/Loaf/Presenter/Controller.swift +++ b/Sources/Loaf/Presenter/Controller.swift @@ -41,7 +41,9 @@ final class Controller: UIPresentationController { containerInsets = UIEdgeInsets(top: min(statusBarSize.width, statusBarSize.height), left: 0, bottom: 0, right: 0) } - if let tabBar = loaf.sender?.parent as? UITabBarController{ + if let tabBar = loaf.sender?.parent as? UITabBarController { + containerInsets.bottom += tabBar.tabBar.frame.height + } else if let tabBar = loaf.sender?.parent?.parent as? UITabBarController { containerInsets.bottom += tabBar.tabBar.frame.height }