From 1698f769cd2a86cca0f4c8bcbd886ce3e80d6899 Mon Sep 17 00:00:00 2001 From: Seoyeon Park <110394722+syss220211@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:49:35 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8[Feat]=20Routert=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20(#17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/App/Sources/ContentView.swift | 6 +- .../Router/Ex+View+Navigation.swift | 40 ++++++++++++ .../Tabbar+Navigation/Router/Router.swift | 62 +++++++++++++++++++ .../Tabbar+Navigation/Router/RouterView.swift | 38 ++++++++++++ .../Tabbar/Sample/AnotherView.swift | 19 ++++++ .../Tabbar/Sample/SampleView.swift | 62 +++++++++++++++++++ .../Tabbar+Navigation/Tabbar/Tabbar.swift | 58 +++++++++++++++++ .../Tabbar/TabbarMainView.swift | 35 +++++++++++ .../Tabbar+Navigation/Tabbar/TabbarView.swift | 40 ++++++++++++ .../Tabbar/ViewModel/TabbarViewModel.swift | 13 ++++ 10 files changed, 370 insertions(+), 3 deletions(-) create mode 100644 Projects/App/Sources/Presentation/Tabbar+Navigation/Router/Ex+View+Navigation.swift create mode 100644 Projects/App/Sources/Presentation/Tabbar+Navigation/Router/Router.swift create mode 100644 Projects/App/Sources/Presentation/Tabbar+Navigation/Router/RouterView.swift create mode 100644 Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Sample/AnotherView.swift create mode 100644 Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Sample/SampleView.swift create mode 100644 Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Tabbar.swift create mode 100644 Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/TabbarMainView.swift create mode 100644 Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/TabbarView.swift create mode 100644 Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/ViewModel/TabbarViewModel.swift diff --git a/Projects/App/Sources/ContentView.swift b/Projects/App/Sources/ContentView.swift index 46e5cbe..1ad63b8 100644 --- a/Projects/App/Sources/ContentView.swift +++ b/Projects/App/Sources/ContentView.swift @@ -11,9 +11,9 @@ import DesignSystem struct ContentView: View { var body: some View { - Text("Hello, World!") - .applyFont(font: .heading1) - Text("Hello, World!") + RouterView { + TabbarMainView() + } } } diff --git a/Projects/App/Sources/Presentation/Tabbar+Navigation/Router/Ex+View+Navigation.swift b/Projects/App/Sources/Presentation/Tabbar+Navigation/Router/Ex+View+Navigation.swift new file mode 100644 index 0000000..844f441 --- /dev/null +++ b/Projects/App/Sources/Presentation/Tabbar+Navigation/Router/Ex+View+Navigation.swift @@ -0,0 +1,40 @@ +// +// Ex+View+Navigation.swift +// DesignSystem +// +// Created by 박서연 on 2024/06/12. +// Copyright © 2024 iOS. All rights reserved. +// + +import SwiftUI + +public extension View { + func navigationBackButton(_ action: @escaping () -> Void) -> some View { + self.navigationBarBackButtonHidden() + .toolbar { + ToolbarItem(placement: .topBarLeading) { + Button(action: action, label: { + // TODO: - 백버튼 이미지 수정 + + Image("arrowBack") + .resizable() + .frame(width: 24, height: 24) + }) + } + } + } + + func navigationTitle(with text: Text) -> some View { + VStack(spacing: 31) { + HStack(spacing: 0) { + text + .applyFont(font: .heading1) + .frame(height: 47) + .frame(maxWidth: .infinity, alignment: .leading) + .padding(.init(top: 10, leading: 22, bottom: 10, trailing: 0)) + Spacer() + } + self + } + } +} diff --git a/Projects/App/Sources/Presentation/Tabbar+Navigation/Router/Router.swift b/Projects/App/Sources/Presentation/Tabbar+Navigation/Router/Router.swift new file mode 100644 index 0000000..97e6e96 --- /dev/null +++ b/Projects/App/Sources/Presentation/Tabbar+Navigation/Router/Router.swift @@ -0,0 +1,62 @@ +// +// Router.swift +// DesignSystem +// +// Created by 박서연 on 2024/06/12. +// Copyright © 2024 iOS. All rights reserved. +// + +import Foundation +import SwiftUI + +public class Router: ObservableObject { + public enum Route: Hashable, Identifiable { + public var id: Self { self } + + case tabView + case login + case home + case category + case mypage + case review + case setting + } + + @Published public var path: NavigationPath = NavigationPath() + + @ViewBuilder public func view(for route: Route) -> some View { + switch route { + case .tabView: + TabbarMainView() + case .login: + Text("login") + case .home: + HomeView() + case .category: + CategoryView() + case .mypage: + MypageView() + case .review: + AnotherView() + case .setting: + Text("setting") + } + } + + public func navigateTo(_ page: Route) { + path.append(page) + } + + public func navigateBack() { + path.removeLast() + } + + public func popToRoot() { + path.removeLast(path.count) + } + + public func replaceNavigationStack(_ page: Route) { + path.removeLast(path.count) + path.append(page) + } +} diff --git a/Projects/App/Sources/Presentation/Tabbar+Navigation/Router/RouterView.swift b/Projects/App/Sources/Presentation/Tabbar+Navigation/Router/RouterView.swift new file mode 100644 index 0000000..0ff8be9 --- /dev/null +++ b/Projects/App/Sources/Presentation/Tabbar+Navigation/Router/RouterView.swift @@ -0,0 +1,38 @@ +// +// RouterView.swift +// DesignSystem +// +// Created by 박서연 on 2024/06/12. +// Copyright © 2024 iOS. All rights reserved. +// + +import SwiftUI + +struct RouterView: View { + @StateObject var router: Router = Router() + private let content: Content + + init(@ViewBuilder content: @escaping () -> Content) { + self.content = content() + } + + var body: some View { + NavigationStack(path: $router.path) { + VStack { + content + } + .navigationDestination(for: Router.Route.self) { route in + router.view(for: route) + } + .onAppear { + router.navigateTo(.tabView) + } + .navigationBarTitle("", displayMode: .inline) + } + .environmentObject(router) + } +} + +//#Preview { +// RouterView() +//} diff --git a/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Sample/AnotherView.swift b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Sample/AnotherView.swift new file mode 100644 index 0000000..4db7482 --- /dev/null +++ b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Sample/AnotherView.swift @@ -0,0 +1,19 @@ +// +// AnotherView.swift +// App +// +// Created by 박서연 on 2024/06/13. +// Copyright © 2024 iOS. All rights reserved. +// + +import SwiftUI + +struct AnotherView: View { + var body: some View { + Text("Saaaaample Viewwwwww") + } +} + +#Preview { + AnotherView() +} diff --git a/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Sample/SampleView.swift b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Sample/SampleView.swift new file mode 100644 index 0000000..a4c8db8 --- /dev/null +++ b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Sample/SampleView.swift @@ -0,0 +1,62 @@ +// +// HomeView.swift +// DesignSystem +// +// Created by 박서연 on 2024/06/12. +// Copyright © 2024 iOS. All rights reserved. +// + +import SwiftUI + +struct HomeView: View { + @EnvironmentObject var router: Router + @EnvironmentObject var viewModel: TabbarViewModel + + var body: some View { + ZStack { + Color.red + .ignoresSafeArea() + Text("Go TO CATEGORY VIEW") + .onTapGesture { + viewModel.selected = .category + } + .foregroundStyle(.white) + } + } +} + +struct CategoryView: View { + @EnvironmentObject var router: Router + @EnvironmentObject var viewModel: TabbarViewModel + + var body: some View { + ZStack { + Color.yellow + .ignoresSafeArea() + Text("GO TO MYPAGEVIEW") + .onTapGesture { + viewModel.selected = .mypage + } + } + } +} + +struct MypageView: View { + @EnvironmentObject var router: Router + @EnvironmentObject var viewModel: TabbarViewModel + + var body: some View { + ZStack { + Color.green + .ignoresSafeArea() + Text("GO TO Another View") + .onTapGesture { + router.replaceNavigationStack(.review) + } + } + } +} + +#Preview { + HomeView() +} diff --git a/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Tabbar.swift b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Tabbar.swift new file mode 100644 index 0000000..ded8fd4 --- /dev/null +++ b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/Tabbar.swift @@ -0,0 +1,58 @@ +// +// Tabbar.swift +// DesignSystem +// +// Created by 박서연 on 2024/06/12. +// Copyright © 2024 iOS. All rights reserved. +// + +import SwiftUI + +enum Tabbar: CaseIterable { + case home, category, mypage + + @ViewBuilder + var view: some View { + switch self { + case .home: + HomeView() + case .category: + CategoryView() + case .mypage: + MypageView() + } + } + + var title: String { + switch self { + case .home: + "홈" + case .category: + "키테고리 검색" + case .mypage: + "마이페이지" + } + } + +// var image: Image { +// switch self { +// case .home: +// <#code#> +// case .category: +// <#code#> +// case .mypage: +// <#code#> +// } +// } + +// var image_fill: Image { +// switch self { +// case .home: +// <#code#> +// case .category: +// <#code#> +// case .mypage: +// <#code#> +// } +// } +} diff --git a/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/TabbarMainView.swift b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/TabbarMainView.swift new file mode 100644 index 0000000..8a9bf04 --- /dev/null +++ b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/TabbarMainView.swift @@ -0,0 +1,35 @@ +// +// TabbarMainView.swift +// DesignSystem +// +// Created by 박서연 on 2024/06/12. +// Copyright © 2024 iOS. All rights reserved. +// + +import SwiftUI + +struct TabbarMainView: View { + @StateObject public var viewModel = TabbarViewModel() + + var body: some View { + NavigationStack { + TabView(selection: $viewModel.selected) { + ForEach(Tabbar.allCases, id: \.self) { tab in + tab.view + } + .toolbarBackground(.hidden, for: .tabBar) + } + } + .overlay { + VStack { + Spacer() + TabbarView(viewModel: viewModel) + } + } + .environmentObject(viewModel) + } +} + +#Preview { + TabbarMainView() +} diff --git a/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/TabbarView.swift b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/TabbarView.swift new file mode 100644 index 0000000..29db16c --- /dev/null +++ b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/TabbarView.swift @@ -0,0 +1,40 @@ +// +// TabbarView.swift +// DesignSystem +// +// Created by 박서연 on 2024/06/12. +// Copyright © 2024 iOS. All rights reserved. +// + +import SwiftUI + +struct TabbarView: View { + @ObservedObject var viewModel: TabbarViewModel + + var body: some View { + HStack { + ForEach(Tabbar.allCases, id: \.self) { item in + Button { + viewModel.selected = item + } label: { + VStack(spacing: 0) { + Image(systemName: "house") + .frame(width: 39, height: 39) + Text(item.title) + .applyFont(font: .label1) + .foregroundStyle(Color.neutral400) + } + } + .frame(maxWidth: .infinity, alignment: .center) + .padding(.bottom, 10) + .onTapGesture { + viewModel.selected = item + } + } + } + } +} + +#Preview { + TabbarView(viewModel: TabbarViewModel()) +} diff --git a/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/ViewModel/TabbarViewModel.swift b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/ViewModel/TabbarViewModel.swift new file mode 100644 index 0000000..d5f0869 --- /dev/null +++ b/Projects/App/Sources/Presentation/Tabbar+Navigation/Tabbar/ViewModel/TabbarViewModel.swift @@ -0,0 +1,13 @@ +// +// TabbarViewModel.swift +// App +// +// Created by 박서연 on 2024/06/13. +// Copyright © 2024 iOS. All rights reserved. +// + +import SwiftUI + +final class TabbarViewModel: ObservableObject { + @Published var selected: Tabbar = .home +} From 87db988519b76d3068a4e29277139525a50433ff Mon Sep 17 00:00:00 2001 From: Seoyeon Park <110394722+syss220211@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:28:30 +0900 Subject: [PATCH 2/2] :bento: [Design] Add Tabbar Assest (#19) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 💄 [Design] 색상 디자인 시스템 추가 * :bento: [Design] Add Tabbar Assests * :bento: Add Font * :adhesive_bandage: [Fix] fix merge error - conflict 수정하면서 발생한 merge error 수정 --- Projects/DesignSystem/Project.swift | 2 +- .../Info/Negative.colorset/Contents.json | 6 ++--- .../Assets.xcassets/Common/Contents.json | 6 +++++ .../progress_gray.imageset/Contents.json | 12 ++++++++++ .../progress_gray.imageset/progress_gray.svg | 8 +++++++ .../Assets.xcassets/Tabbar/Contents.json | 6 +++++ .../ic_category_empty.imageset/Contents.json | 12 ++++++++++ .../ic_category_empty.svg | 5 ++++ .../ic_category_fill.imageset/Contents.json | 12 ++++++++++ .../ic_category_fill.svg | 5 ++++ .../ic_home_empty.imageset/Contents.json | 12 ++++++++++ .../ic_home_empty.imageset/ic_home_empty.svg | 4 ++++ .../ic_home_fill.imageset/Contents.json | 12 ++++++++++ .../ic_home_fill.imageset/ic_home_fill.svg | 4 ++++ .../ic_mypage_empty.imageset/Contents.json | 12 ++++++++++ .../ic_mypage_empty.svg | 4 ++++ .../ic_mypage_fill.imageset/Contents.json | 12 ++++++++++ .../ic_mypage_fill.svg | 4 ++++ .../Sources/Assets/AssestsTestView.swift | 23 +++++++++++++++++++ .../Assets/Common/Common+Assests.swift | 13 +++++++++++ .../Sources/Assets/Tab/Tabbar.swift | 18 +++++++++++++++ Projects/DesignSystem/Sources/Font/Font.swift | 13 ++++++++--- 22 files changed, 198 insertions(+), 7 deletions(-) create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Common/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Common/progress_gray.imageset/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Common/progress_gray.imageset/progress_gray.svg create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_empty.imageset/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_empty.imageset/ic_category_empty.svg create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_fill.imageset/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_fill.imageset/ic_category_fill.svg create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_empty.imageset/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_empty.imageset/ic_home_empty.svg create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_fill.imageset/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_fill.imageset/ic_home_fill.svg create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_empty.imageset/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_empty.imageset/ic_mypage_empty.svg create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_fill.imageset/Contents.json create mode 100644 Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_fill.imageset/ic_mypage_fill.svg create mode 100644 Projects/DesignSystem/Sources/Assets/AssestsTestView.swift create mode 100644 Projects/DesignSystem/Sources/Assets/Common/Common+Assests.swift create mode 100644 Projects/DesignSystem/Sources/Assets/Tab/Tabbar.swift diff --git a/Projects/DesignSystem/Project.swift b/Projects/DesignSystem/Project.swift index f5b4e29..39d2419 100644 --- a/Projects/DesignSystem/Project.swift +++ b/Projects/DesignSystem/Project.swift @@ -26,5 +26,5 @@ let designSystemTarget = Target.makeTarget( let designSystemProject = Project.makeProject( name: "DesignSystem", targets: designSystemTarget, - isXconfigSet: true) + isXconfigSet: false) diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Color/Info/Negative.colorset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/Color/Info/Negative.colorset/Contents.json index 63d0ff8..6825ed4 100644 --- a/Projects/DesignSystem/Resources/Assets.xcassets/Color/Info/Negative.colorset/Contents.json +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Color/Info/Negative.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.251", - "green" : "0.251", - "red" : "1.000" + "blue" : "0.149", + "green" : "0.192", + "red" : "0.984" } }, "idiom" : "universal" diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Common/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/Common/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Common/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Common/progress_gray.imageset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/Common/progress_gray.imageset/Contents.json new file mode 100644 index 0000000..ba895f0 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Common/progress_gray.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "progress_gray.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Common/progress_gray.imageset/progress_gray.svg b/Projects/DesignSystem/Resources/Assets.xcassets/Common/progress_gray.imageset/progress_gray.svg new file mode 100644 index 0000000..65524ec --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Common/progress_gray.imageset/progress_gray.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_empty.imageset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_empty.imageset/Contents.json new file mode 100644 index 0000000..3197d37 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_empty.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "ic_category_empty.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_empty.imageset/ic_category_empty.svg b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_empty.imageset/ic_category_empty.svg new file mode 100644 index 0000000..93a76e8 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_empty.imageset/ic_category_empty.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_fill.imageset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_fill.imageset/Contents.json new file mode 100644 index 0000000..5619351 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_fill.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "ic_category_fill.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_fill.imageset/ic_category_fill.svg b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_fill.imageset/ic_category_fill.svg new file mode 100644 index 0000000..334379d --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_category_fill.imageset/ic_category_fill.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_empty.imageset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_empty.imageset/Contents.json new file mode 100644 index 0000000..79e0aff --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_empty.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "ic_home_empty.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_empty.imageset/ic_home_empty.svg b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_empty.imageset/ic_home_empty.svg new file mode 100644 index 0000000..6f0a2e8 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_empty.imageset/ic_home_empty.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_fill.imageset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_fill.imageset/Contents.json new file mode 100644 index 0000000..cb61b18 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_fill.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "ic_home_fill.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_fill.imageset/ic_home_fill.svg b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_fill.imageset/ic_home_fill.svg new file mode 100644 index 0000000..40154de --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_home_fill.imageset/ic_home_fill.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_empty.imageset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_empty.imageset/Contents.json new file mode 100644 index 0000000..60bd379 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_empty.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "ic_mypage_empty.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_empty.imageset/ic_mypage_empty.svg b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_empty.imageset/ic_mypage_empty.svg new file mode 100644 index 0000000..1e10d1f --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_empty.imageset/ic_mypage_empty.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_fill.imageset/Contents.json b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_fill.imageset/Contents.json new file mode 100644 index 0000000..2cdb440 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_fill.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "ic_mypage_fill.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_fill.imageset/ic_mypage_fill.svg b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_fill.imageset/ic_mypage_fill.svg new file mode 100644 index 0000000..d645d46 --- /dev/null +++ b/Projects/DesignSystem/Resources/Assets.xcassets/Tabbar/ic_mypage_fill.imageset/ic_mypage_fill.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Projects/DesignSystem/Sources/Assets/AssestsTestView.swift b/Projects/DesignSystem/Sources/Assets/AssestsTestView.swift new file mode 100644 index 0000000..b730383 --- /dev/null +++ b/Projects/DesignSystem/Sources/Assets/AssestsTestView.swift @@ -0,0 +1,23 @@ +// +// AssestsTestView.swift +// DesignSystem +// +// Created by 박서연 on 2024/06/18. +// Copyright © 2024 iOS. All rights reserved. +// + +import SwiftUI + +struct AssestsTestView: View { + var body: some View { + VStack { + ZerosomeTab.ic_home + ZerosomeAsset.zero_progress + } + .background(.green) + } +} + +#Preview { + AssestsTestView() +} diff --git a/Projects/DesignSystem/Sources/Assets/Common/Common+Assests.swift b/Projects/DesignSystem/Sources/Assets/Common/Common+Assests.swift new file mode 100644 index 0000000..0e595fe --- /dev/null +++ b/Projects/DesignSystem/Sources/Assets/Common/Common+Assests.swift @@ -0,0 +1,13 @@ +// +// Common+Assests.swift +// DesignSystem +// +// Created by 박서연 on 2024/06/18. +// Copyright © 2024 iOS. All rights reserved. +// + +import SwiftUI + +public struct ZerosomeAsset { + public static let zero_progress = DesignSystemAsset.Assets.progressGray.swiftUIImage +} diff --git a/Projects/DesignSystem/Sources/Assets/Tab/Tabbar.swift b/Projects/DesignSystem/Sources/Assets/Tab/Tabbar.swift new file mode 100644 index 0000000..23f02ba --- /dev/null +++ b/Projects/DesignSystem/Sources/Assets/Tab/Tabbar.swift @@ -0,0 +1,18 @@ +// +// Tabbar.swift +// DesignSystem +// +// Created by 박서연 on 2024/06/18. +// Copyright © 2024 iOS. All rights reserved. +// + +import SwiftUI + +public enum ZerosomeTab { + public static let ic_home = DesignSystemAsset.Assets.icHomeEmpty.swiftUIImage + public static let ic_home_fill = DesignSystemAsset.Assets.icHomeFill.swiftUIImage + public static let ic_category = DesignSystemAsset.Assets.icCategoryEmpty.swiftUIImage + public static let ic_category_fill = DesignSystemAsset.Assets.icCategoryFill.swiftUIImage + public static let ic_mypage = DesignSystemAsset.Assets.icMypageEmpty.swiftUIImage + public static let ic_mpyage_fi = DesignSystemAsset.Assets.icMypageFill.swiftUIImage +} diff --git a/Projects/DesignSystem/Sources/Font/Font.swift b/Projects/DesignSystem/Sources/Font/Font.swift index cc2a102..bcf460e 100644 --- a/Projects/DesignSystem/Sources/Font/Font.swift +++ b/Projects/DesignSystem/Sources/Font/Font.swift @@ -5,7 +5,6 @@ // Created by 박서연 on 2024/05/12. // Copyright © 2024 iOS. All rights reserved. // -import UIKit import SwiftUI public enum ZSFont { @@ -16,6 +15,7 @@ public enum ZSFont { case body1 case body2 case body3 + case body4 case label1 case label2 case caption @@ -39,6 +39,8 @@ extension ZSFont { return DesignSystemFontFamily.Pretendard.medium.name case .body3: return DesignSystemFontFamily.Pretendard.medium.name + case .body4: + return DesignSystemFontFamily.Pretendard.medium.name case .label1: return DesignSystemFontFamily.Pretendard.medium.name case .label2: @@ -64,8 +66,10 @@ extension ZSFont { return 14 case .body3: return 13 - case .label1: + case .body4: return 12 + case .label1: + return 13 case .label2: return 11 case .caption: @@ -89,6 +93,8 @@ extension ZSFont { return CGFloat(ZSFont.body2.size * 0.140) case .body3: return CGFloat(ZSFont.body2.size * 0.140) + case .body4: + return CGFloat(ZSFont.body2.size * 0.140) case .label1: return CGFloat(ZSFont.label1.size * 0.140) case .label2: @@ -114,6 +120,8 @@ extension ZSFont { return 0 case .body3: return 0 + case .body4: + return 0 case .label1: return 0 case .label2: @@ -126,7 +134,6 @@ extension ZSFont { public var toUIFont: UIFont { return UIFont(name: self.name, size: self.size) ?? UIFont.systemFont(ofSize: self.size) } - } public struct FontModifier: ViewModifier {