From ff65ab0732ad61125c0dee571c6af62a0357225b Mon Sep 17 00:00:00 2001 From: opficdev <162981733+opficdev@users.noreply.github.com> Date: Sun, 7 Jun 2026 21:31:21 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20Toast=EB=A5=BC=20=ED=83=AD=EB=B0=94?= =?UTF-8?q?=20=EB=86=92=EC=9D=B4=EB=A7=8C=ED=81=BC=20=EB=9D=84=EC=9A=B0?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Common/Component/Toast.swift | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/Application/DevLogPresentation/Sources/Common/Component/Toast.swift b/Application/DevLogPresentation/Sources/Common/Component/Toast.swift index 4af409ec..6ea39d1c 100644 --- a/Application/DevLogPresentation/Sources/Common/Component/Toast.swift +++ b/Application/DevLogPresentation/Sources/Common/Component/Toast.swift @@ -85,11 +85,19 @@ extension View { } private struct ToastHostModifier: ViewModifier { + @Environment(\.safeAreaInsets) private var safeAreaInsets + @State private var tabBarHeight = CGFloat.zero private let toastPresenter = ToastPresenter.presenter func body(content: Content) -> some View { content .frame(maxWidth: .infinity, maxHeight: .infinity) + .onAppear { + updateTabBarHeight() + } + .onChange(of: toastPresenter.item?.id) { _, _ in + updateTabBarHeight() + } .overlay(alignment: .bottom) { if let item = toastPresenter.item { ToastOverlayView( @@ -109,9 +117,28 @@ private struct ToastHostModifier: ViewModifier { } .id(item.id) .padding(.horizontal, 12) + .padding(.bottom, toastBottomInset) } } } + + private var toastBottomInset: CGFloat { + max(0, tabBarHeight - safeAreaInsets.bottom) + } + + @MainActor + private func updateTabBarHeight() { + let window = UIApplication.shared.connectedScenes + .compactMap { $0 as? UIWindowScene } + .flatMap(\.windows) + .first { $0.isKeyWindow } + + guard let window else { + tabBarHeight = .zero + return + } + tabBarHeight = window.rootViewController?.visibleTabBarHeight ?? .zero + } } private struct ToastItemLabel: View { @@ -279,3 +306,30 @@ private struct ToastCardView: View { .shadow(color: Color(.systemGray2).opacity(0.4), radius: 18, x: 0, y: 10) } } + +@MainActor +private extension UIViewController { + var visibleTabBarHeight: CGFloat { + if let tabBarController = self as? UITabBarController { + return tabBarController.tabBar.isHidden ? .zero : tabBarController.tabBar.frame.height + } + + if let tabBarController { + return tabBarController.tabBar.isHidden ? .zero : tabBarController.tabBar.frame.height + } + + if let presentedViewController, + 0 < presentedViewController.visibleTabBarHeight { + return presentedViewController.visibleTabBarHeight + } + + for child in children { + let childHeight = child.visibleTabBarHeight + if 0 < childHeight { + return childHeight + } + } + + return .zero + } +} From a2bf63910b8c6f81de88dc613b26f5e8d4960e89 Mon Sep 17 00:00:00 2001 From: opficdev <162981733+opficdev@users.noreply.github.com> Date: Sun, 7 Jun 2026 22:38:02 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EB=AA=A8=EB=8B=AC=20=EB=85=B8?= =?UTF-8?q?=EC=B6=9C=20=EC=8B=9C=20Toast=20=ED=83=AD=EB=B0=94=20=EB=86=92?= =?UTF-8?q?=EC=9D=B4=20=EA=B3=84=EC=82=B0=EC=9D=84=20=EB=B3=B4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Common/Component/Toast.swift | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Application/DevLogPresentation/Sources/Common/Component/Toast.swift b/Application/DevLogPresentation/Sources/Common/Component/Toast.swift index 6ea39d1c..7e09ec5d 100644 --- a/Application/DevLogPresentation/Sources/Common/Component/Toast.swift +++ b/Application/DevLogPresentation/Sources/Common/Component/Toast.swift @@ -310,20 +310,17 @@ private struct ToastCardView: View { @MainActor private extension UIViewController { var visibleTabBarHeight: CGFloat { - if let tabBarController = self as? UITabBarController { - return tabBarController.tabBar.isHidden ? .zero : tabBarController.tabBar.frame.height - } + var topViewController = self - if let tabBarController { - return tabBarController.tabBar.isHidden ? .zero : tabBarController.tabBar.frame.height + while let presentedViewController = topViewController.presentedViewController { + topViewController = presentedViewController } - if let presentedViewController, - 0 < presentedViewController.visibleTabBarHeight { - return presentedViewController.visibleTabBarHeight + if let tabBarController = (topViewController as? UITabBarController) ?? topViewController.tabBarController { + return tabBarController.tabBar.isHidden ? .zero : tabBarController.tabBar.frame.height } - for child in children { + for child in topViewController.children { let childHeight = child.visibleTabBarHeight if 0 < childHeight { return childHeight