Skip to content

Commit a2bf639

Browse files
committed
fix: 모달 노출 시 Toast 탭바 높이 계산을 보정
1 parent ff65ab0 commit a2bf639

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

  • Application/DevLogPresentation/Sources/Common/Component

Application/DevLogPresentation/Sources/Common/Component/Toast.swift

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,20 +310,17 @@ private struct ToastCardView<Label: View>: View {
310310
@MainActor
311311
private extension UIViewController {
312312
var visibleTabBarHeight: CGFloat {
313-
if let tabBarController = self as? UITabBarController {
314-
return tabBarController.tabBar.isHidden ? .zero : tabBarController.tabBar.frame.height
315-
}
313+
var topViewController = self
316314

317-
if let tabBarController {
318-
return tabBarController.tabBar.isHidden ? .zero : tabBarController.tabBar.frame.height
315+
while let presentedViewController = topViewController.presentedViewController {
316+
topViewController = presentedViewController
319317
}
320318

321-
if let presentedViewController,
322-
0 < presentedViewController.visibleTabBarHeight {
323-
return presentedViewController.visibleTabBarHeight
319+
if let tabBarController = (topViewController as? UITabBarController) ?? topViewController.tabBarController {
320+
return tabBarController.tabBar.isHidden ? .zero : tabBarController.tabBar.frame.height
324321
}
325322

326-
for child in children {
323+
for child in topViewController.children {
327324
let childHeight = child.visibleTabBarHeight
328325
if 0 < childHeight {
329326
return childHeight

0 commit comments

Comments
 (0)