Skip to content

Commit 213fedc

Browse files
authored
Fix the bottom constraint issue on iPadOS 18+ when the tab bar has no superview or frame is empty (#578)
1 parent 920d846 commit 213fedc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SwiftMessages/Presenter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class Presenter: NSObject {
339339
}
340340

341341
func bottomLayoutConstraint(view: UIView, containerView: UIView, viewController: UIViewController?) -> NSLayoutConstraint {
342-
if case .bottom = config.presentationStyle.topBottomStyle, let tab = viewController as? UITabBarController, tab.sm_isVisible(view: tab.tabBar) {
342+
if case .bottom = config.presentationStyle.topBottomStyle, let tab = viewController as? UITabBarController, tab.sm_isVisible(view: tab.tabBar), tab.tabBar.superview != nil, !tab.tabBar.frame.isEmpty {
343343
return NSLayoutConstraint(item: view, attribute: .bottom, relatedBy: .equal, toItem: tab.tabBar, attribute: .top, multiplier: 1.00, constant: 0.0)
344344
}
345345
return NSLayoutConstraint(item: view, attribute: .bottom, relatedBy: .equal, toItem: containerView, attribute: .bottom, multiplier: 1.00, constant: 0.0)

0 commit comments

Comments
 (0)