Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for #37 #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix for #37 #38

wants to merge 1 commit into from

Conversation

fgeistert
Copy link

@fgeistert fgeistert commented Apr 22, 2022

checks if parent or parent is UITabBarController. resolves #37

Copy link
Owner

@schmidyy schmidyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contributions! I left one small comment :)

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 {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should also check if the loaf.sender?.parent is a UINavigationController here, because I worry that the "parent's parent" might be a screen that is hidden from the current view. How does this look?

Suggested change
} else if let tabBar = loaf.sender?.parent?.parent as? UITabBarController {
} else if let navController = loaf.sender?.parent as? UINavigationController, let tabBar = navController.parent as? UITabBarController {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UITabBarController inset not respected if UIViewController is wrapped inside UINavigationController
2 participants