Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions GAMSS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<string>$(BASE_URL)</string>
<key>FIREBASE_CRASHLYTICS_COLLECTION_ENABLED</key>
<string>NO</string>
<key>UIDesignRequiresCompatibility</key>
<true/>
<key>UIAppFonts</key>
<array>
<string>Pretendard-Regular.otf</string>
Expand Down
25 changes: 25 additions & 0 deletions GAMSS/Resources/Assets.xcassets/tabIconChat.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "tabIconChat@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tabIconChat@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"properties" : {
"template-rendering-intent" : "template"
},
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions GAMSS/Resources/Assets.xcassets/tabIconHome.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "tabIconHome@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tabIconHome@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"properties" : {
"template-rendering-intent" : "template"
},
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import SwiftUI

struct ConversationListView: View {
@StateObject private var viewModel: ConversationListViewModel
@Binding private var isTabBarHidden: Bool

init(viewModel: ConversationListViewModel, isTabBarHidden: Binding<Bool>) {
init(viewModel: ConversationListViewModel) {
_viewModel = StateObject(wrappedValue: viewModel)
_isTabBarHidden = isTabBarHidden
}

var body: some View {
Expand All @@ -38,8 +36,7 @@ struct ConversationListView: View {
conversationId: conversation.id
)
)
.onAppear { isTabBarHidden = true }
.onDisappear { isTabBarHidden = false }
.toolbar(.hidden, for: .tabBar)
}
}
.task {
Expand All @@ -60,7 +57,6 @@ struct ConversationListView: View {
getConversationsUseCase: GetConversationsUseCase(
conversationRepository: DefaultConversationRepository(networkManager: NetworkManager.shared)
)
),
isTabBarHidden: .constant(false)
)
)
}
10 changes: 3 additions & 7 deletions GAMSS/Sources/Presentation/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ import SwiftUI
struct HomeView: View {
@StateObject private var viewModel: HomeViewModel
@FocusState private var isInputFocused: Bool
@Binding private var isTabBarHidden: Bool

init(viewModel: HomeViewModel, isTabBarHidden: Binding<Bool>) {
init(viewModel: HomeViewModel) {
_viewModel = StateObject(wrappedValue: viewModel)
_isTabBarHidden = isTabBarHidden
}

var body: some View {
Expand Down Expand Up @@ -57,8 +55,7 @@ struct HomeView: View {
initialSentMessage: viewModel.createdSentMessage
)
)
.onAppear { isTabBarHidden = true }
.onDisappear { isTabBarHidden = false }
.toolbar(.hidden, for: .tabBar)
}
}
.alert(viewModel.alertMessage ?? "", isPresented: Binding(
Expand Down Expand Up @@ -139,7 +136,6 @@ struct HomeView: View {
sendMessageUseCase: SendMessageUseCase(
conversationRepository: DefaultConversationRepository(networkManager: NetworkManager.shared)
)
),
isTabBarHidden: .constant(false)
)
)
}
59 changes: 0 additions & 59 deletions GAMSS/Sources/Presentation/Root/CustomTabBar.swift

This file was deleted.

62 changes: 38 additions & 24 deletions GAMSS/Sources/Presentation/Root/MainTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,62 @@ import SwiftUI

struct MainTabView: View {
@State private var selectedTab: MainTab = .home
@State private var isTabBarHidden = false

var body: some View {
content
.safeAreaInset(edge: .bottom) {
if !isTabBarHidden {
CustomTabBar(selectedTab: $selectedTab)
.padding(.horizontal, Spacing.spacing400)
.padding(.bottom, Spacing.spacing200)
.transition(.opacity)
}
}
.animation(.easeInOut(duration: 0.15), value: isTabBarHidden)
}
init() {
let appearance = UITabBarAppearance()
let font = UIFont(name: FontWeight.medium.postScriptName(), size: Typography.caption3.metrics.fontSize)

@ViewBuilder
private var content: some View {
switch selectedTab {
case .archive:
ArchiveView()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = UIColor(Color.colorWhite)

appearance.stackedLayoutAppearance.selected.iconColor = UIColor(Color.colorGray950)
appearance.stackedLayoutAppearance.selected.titleTextAttributes = [
.foregroundColor: UIColor(Color.colorGray950),
.font: font as Any
]
appearance.stackedLayoutAppearance.normal.iconColor = UIColor(Color.colorGray300)
appearance.stackedLayoutAppearance.normal.titleTextAttributes = [
.foregroundColor: UIColor(Color.colorGray300),
.font: font as Any
]

UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = appearance
}

case .home:
var body: some View {
TabView(selection: $selectedTab) {
HomeView(
viewModel: HomeViewModel(
sendMessageUseCase: SendMessageUseCase(
conversationRepository: DefaultConversationRepository(networkManager: NetworkManager.shared)
)
),
isTabBarHidden: $isTabBarHidden
)
)
.tabItem { tabLabel(for: .home) }
.tag(MainTab.home)

case .chat:
ConversationListView(
viewModel: ConversationListViewModel(
getConversationsUseCase: GetConversationsUseCase(
conversationRepository: DefaultConversationRepository(networkManager: NetworkManager.shared)
)
),
isTabBarHidden: $isTabBarHidden
)
)
.tabItem { tabLabel(for: .chat) }
.tag(MainTab.chat)

// 보관함 탭은 아직 노출하지 않음 — Figma 시안에서 당장 필요 없다고 확인됨.
// MainTab.archive case와 ArchiveView는 그대로 남겨두었으니, 실제 기능이 붙는 시점에
// 여기 .tabItem을 추가하기만 하면 된다 (임의로 다시 추가하지 말 것).
}
}

@ViewBuilder
private func tabLabel(for tab: MainTab) -> some View {
Image(tab.iconName).renderingMode(.template)
Text(tab.title)
}
}

#Preview {
Expand Down
Loading