From 851c1432d1694e11d3cded20a188a354ba4c5b0a Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Thu, 29 Aug 2024 14:22:16 +0900 Subject: [PATCH 01/16] :heavy_plus_sign: :: add TCA --- .../Dependency+SPM.swift | 1 + .../ProjectDescriptionHelpers/ModulePaths.swift | 1 + Projects/Feature/BaseFeature/Project.swift | 3 ++- Projects/Feature/MainTabFeature/Project.swift | 8 ++++++++ .../Feature/MainTabFeature/Sources/Sources.swift | 8 ++++++++ Projects/Feature/MainTabFeature/Tests/Tests.swift | 8 ++++++++ Tuist/Package.swift | 15 ++++++++------- 7 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 Projects/Feature/MainTabFeature/Project.swift create mode 100644 Projects/Feature/MainTabFeature/Sources/Sources.swift create mode 100644 Projects/Feature/MainTabFeature/Tests/Tests.swift diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift index 50c39b2..99213e7 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift @@ -5,6 +5,7 @@ public extension TargetDependency { } public extension TargetDependency.SPM { + static let ComposableArchitecture = TargetDependency.external(name: "ComposableArchitecture") } public extension Package { diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift index de41181..7497731 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift @@ -24,6 +24,7 @@ extension ModulePaths: ModularTargetPathConvertable { public extension ModulePaths { enum Feature: String, ModularTargetPathConvertable { case BaseFeature + case MainTabFeature } } diff --git a/Projects/Feature/BaseFeature/Project.swift b/Projects/Feature/BaseFeature/Project.swift index 0e05135..1aca02b 100644 --- a/Projects/Feature/BaseFeature/Project.swift +++ b/Projects/Feature/BaseFeature/Project.swift @@ -10,7 +10,8 @@ let project = Project.module( .implements(module: .feature(.BaseFeature), product: .framework, dependencies: [ .feature(target: .BaseFeature, type: .interface), .userInterface(target: .DesignSystem), - .shared(target: .GlobalThirdPartyLibrary) + .shared(target: .GlobalThirdPartyLibrary), + .SPM.ComposableArchitecture ]), .tests(module: .feature(.BaseFeature), dependencies: [ .feature(target: .BaseFeature) diff --git a/Projects/Feature/MainTabFeature/Project.swift b/Projects/Feature/MainTabFeature/Project.swift new file mode 100644 index 0000000..03faed8 --- /dev/null +++ b/Projects/Feature/MainTabFeature/Project.swift @@ -0,0 +1,8 @@ +// +// Project.swift +// AppManifests +// +// Created by 정윤서 on 8/29/24. +// + +import Foundation diff --git a/Projects/Feature/MainTabFeature/Sources/Sources.swift b/Projects/Feature/MainTabFeature/Sources/Sources.swift new file mode 100644 index 0000000..84a7e43 --- /dev/null +++ b/Projects/Feature/MainTabFeature/Sources/Sources.swift @@ -0,0 +1,8 @@ +// +// Sources.swift +// AppManifests +// +// Created by 정윤서 on 8/29/24. +// + +import Foundation diff --git a/Projects/Feature/MainTabFeature/Tests/Tests.swift b/Projects/Feature/MainTabFeature/Tests/Tests.swift new file mode 100644 index 0000000..d4441f4 --- /dev/null +++ b/Projects/Feature/MainTabFeature/Tests/Tests.swift @@ -0,0 +1,8 @@ +// +// Tests.swift +// AppManifests +// +// Created by 정윤서 on 8/29/24. +// + +import Foundation diff --git a/Tuist/Package.swift b/Tuist/Package.swift index 7a37df9..022a946 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -5,18 +5,19 @@ import PackageDescription import ProjectDescription let packageSettings = PackageSettings( - // Customize the product types for specific package product - // Default is .staticFramework - // productTypes: ["Alamofire": .framework,] - productTypes: [:] + productTypes: [:], + baseSettings: .settings( + configurations: [ + .debug(name: .debug), + .release(name: .release) + ] + ) ) #endif let package = Package( name: "OndoseeIOS", dependencies: [ - // Add your own dependencies here: - // .package(url: "https://github.com/Alamofire/Alamofire", from: "5.0.0"), - // You can read more about dependencies here: https://docs.tuist.io/documentation/tuist/dependencies + .package(url: "https://github.com/pointfreeco/swift-composable-architecture.git", from: "1.14.0") ] ) From 829efda82c15c725dbf04277ce7353c29178bb46 Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Thu, 29 Aug 2024 14:24:03 +0900 Subject: [PATCH 02/16] :heavy_plus_sign: :: add Alamofire --- .../ProjectDescriptionHelpers/Dependency+SPM.swift | 1 + Projects/Domain/BaseDomain/Project.swift | 3 ++- Tuist/Package.swift | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift index 99213e7..a2d9714 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift @@ -6,6 +6,7 @@ public extension TargetDependency { public extension TargetDependency.SPM { static let ComposableArchitecture = TargetDependency.external(name: "ComposableArchitecture") + static let Alamofire = TargetDependency.external(name: "Alamofire") } public extension Package { diff --git a/Projects/Domain/BaseDomain/Project.swift b/Projects/Domain/BaseDomain/Project.swift index ba46b59..ea0a5dc 100644 --- a/Projects/Domain/BaseDomain/Project.swift +++ b/Projects/Domain/BaseDomain/Project.swift @@ -15,7 +15,8 @@ let project = Project.module( dependencies: [ .domain(target: .BaseDomain, type: .interface), .core(target: .Networking, type: .interface), - .shared(target: .GlobalThirdPartyLibrary) + .shared(target: .GlobalThirdPartyLibrary), + .SPM.Alamofire ] ), .tests(module: .domain(.BaseDomain), dependencies: [ diff --git a/Tuist/Package.swift b/Tuist/Package.swift index 022a946..3364457 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -18,6 +18,7 @@ import PackageDescription let package = Package( name: "OndoseeIOS", dependencies: [ - .package(url: "https://github.com/pointfreeco/swift-composable-architecture.git", from: "1.14.0") + .package(url: "https://github.com/pointfreeco/swift-composable-architecture.git", from: "1.14.0"), + .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.9.1")) ] ) From 7b9da924d0d58fd5669419c0ab3ceff4518a2a4b Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Thu, 29 Aug 2024 14:25:15 +0900 Subject: [PATCH 03/16] :heavy_plus_sign: :: add Lottie --- .../ProjectDescriptionHelpers/Dependency+SPM.swift | 1 + Projects/UserInterface/DesignSystem/Project.swift | 3 ++- Tuist/Package.swift | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift index a2d9714..cb97806 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift @@ -7,6 +7,7 @@ public extension TargetDependency { public extension TargetDependency.SPM { static let ComposableArchitecture = TargetDependency.external(name: "ComposableArchitecture") static let Alamofire = TargetDependency.external(name: "Alamofire") + static let Lottie = TargetDependency.external(name: "Lottie") } public extension Package { diff --git a/Projects/UserInterface/DesignSystem/Project.swift b/Projects/UserInterface/DesignSystem/Project.swift index ceacd65..bd02087 100644 --- a/Projects/UserInterface/DesignSystem/Project.swift +++ b/Projects/UserInterface/DesignSystem/Project.swift @@ -11,7 +11,8 @@ let project = Project.module( spec: .init( resources: ["Resources/**"], dependencies: [ - .shared(target: .GlobalThirdPartyLibrary) + .shared(target: .GlobalThirdPartyLibrary), + .SPM.Lottieg ] ) ), diff --git a/Tuist/Package.swift b/Tuist/Package.swift index 3364457..adc8369 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -19,6 +19,7 @@ let package = Package( name: "OndoseeIOS", dependencies: [ .package(url: "https://github.com/pointfreeco/swift-composable-architecture.git", from: "1.14.0"), - .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.9.1")) + .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.9.1")), + .package(url: "https://github.com/airbnb/lottie-ios.git", .upToNextMajor(from: "4.5.0")) ] ) From 9a39a63d34610aa86807e7df34172831b5eaf385 Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Thu, 29 Aug 2024 14:58:44 +0900 Subject: [PATCH 04/16] :heavy_plus_sign: :: add Swinject --- .../ProjectDescriptionHelpers/Dependency+SPM.swift | 1 + Projects/Feature/BaseFeature/Project.swift | 3 ++- Projects/UserInterface/DesignSystem/Project.swift | 2 +- Tuist/Package.swift | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift index cb97806..85c53ff 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift @@ -8,6 +8,7 @@ public extension TargetDependency.SPM { static let ComposableArchitecture = TargetDependency.external(name: "ComposableArchitecture") static let Alamofire = TargetDependency.external(name: "Alamofire") static let Lottie = TargetDependency.external(name: "Lottie") + static let Swinject = TargetDependency.external(name: "Swinject") } public extension Package { diff --git a/Projects/Feature/BaseFeature/Project.swift b/Projects/Feature/BaseFeature/Project.swift index 1aca02b..a6d72f4 100644 --- a/Projects/Feature/BaseFeature/Project.swift +++ b/Projects/Feature/BaseFeature/Project.swift @@ -11,7 +11,8 @@ let project = Project.module( .feature(target: .BaseFeature, type: .interface), .userInterface(target: .DesignSystem), .shared(target: .GlobalThirdPartyLibrary), - .SPM.ComposableArchitecture + .SPM.ComposableArchitecture, + .SPM.Swinject ]), .tests(module: .feature(.BaseFeature), dependencies: [ .feature(target: .BaseFeature) diff --git a/Projects/UserInterface/DesignSystem/Project.swift b/Projects/UserInterface/DesignSystem/Project.swift index bd02087..4f66456 100644 --- a/Projects/UserInterface/DesignSystem/Project.swift +++ b/Projects/UserInterface/DesignSystem/Project.swift @@ -12,7 +12,7 @@ let project = Project.module( resources: ["Resources/**"], dependencies: [ .shared(target: .GlobalThirdPartyLibrary), - .SPM.Lottieg + .SPM.Lottie ] ) ), diff --git a/Tuist/Package.swift b/Tuist/Package.swift index adc8369..7bde62d 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -20,6 +20,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/pointfreeco/swift-composable-architecture.git", from: "1.14.0"), .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.9.1")), - .package(url: "https://github.com/airbnb/lottie-ios.git", .upToNextMajor(from: "4.5.0")) + .package(url: "https://github.com/airbnb/lottie-ios.git", .upToNextMajor(from: "4.5.0")), + .package(url: "https://github.com/Swinject/Swinject.git", .upToNextMajor(from: "2.9.1")) ] ) From 2ab2721b0061bb9104d26ff6843e524592932aab Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Thu, 29 Aug 2024 15:01:09 +0900 Subject: [PATCH 05/16] :sparkles: :: add MainTabFeature --- Projects/Feature/MainFeature/Project.swift | 8 + Projects/Feature/MainTabFeature/Project.swift | 19 ++- .../MainTabFeature/Sources/Sources.swift | 8 +- .../Feature/MainTabFeature/Tests/Tests.swift | 9 +- Tuist/Package.resolved | 149 ++++++++++++++++++ 5 files changed, 171 insertions(+), 22 deletions(-) create mode 100644 Projects/Feature/MainFeature/Project.swift create mode 100644 Tuist/Package.resolved diff --git a/Projects/Feature/MainFeature/Project.swift b/Projects/Feature/MainFeature/Project.swift new file mode 100644 index 0000000..03faed8 --- /dev/null +++ b/Projects/Feature/MainFeature/Project.swift @@ -0,0 +1,8 @@ +// +// Project.swift +// AppManifests +// +// Created by 정윤서 on 8/29/24. +// + +import Foundation diff --git a/Projects/Feature/MainTabFeature/Project.swift b/Projects/Feature/MainTabFeature/Project.swift index 03faed8..a2b6e11 100644 --- a/Projects/Feature/MainTabFeature/Project.swift +++ b/Projects/Feature/MainTabFeature/Project.swift @@ -1,8 +1,13 @@ -// -// Project.swift -// AppManifests -// -// Created by 정윤서 on 8/29/24. -// +import DependencyPlugin +import ProjectDescription +import ProjectDescriptionHelpers -import Foundation +let project = Project.module( + name: ModulePaths.Feature.MainTabFeature.rawValue, + targets: [ + .implements(module: .feature(.MainTabFeature), dependencies: [ + .feature(target: .BaseFeature) + ]), + .tests(module: .feature(.MainTabFeature), dependencies: []) + ] +) diff --git a/Projects/Feature/MainTabFeature/Sources/Sources.swift b/Projects/Feature/MainTabFeature/Sources/Sources.swift index 84a7e43..50ff8a0 100644 --- a/Projects/Feature/MainTabFeature/Sources/Sources.swift +++ b/Projects/Feature/MainTabFeature/Sources/Sources.swift @@ -1,8 +1,2 @@ -// -// Sources.swift -// AppManifests -// -// Created by 정윤서 on 8/29/24. -// +import SwiftUI -import Foundation diff --git a/Projects/Feature/MainTabFeature/Tests/Tests.swift b/Projects/Feature/MainTabFeature/Tests/Tests.swift index d4441f4..b1853ce 100644 --- a/Projects/Feature/MainTabFeature/Tests/Tests.swift +++ b/Projects/Feature/MainTabFeature/Tests/Tests.swift @@ -1,8 +1 @@ -// -// Tests.swift -// AppManifests -// -// Created by 정윤서 on 8/29/24. -// - -import Foundation +// This is for Tuist diff --git a/Tuist/Package.resolved b/Tuist/Package.resolved new file mode 100644 index 0000000..d3e2614 --- /dev/null +++ b/Tuist/Package.resolved @@ -0,0 +1,149 @@ +{ + "pins" : [ + { + "identity" : "alamofire", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Alamofire/Alamofire.git", + "state" : { + "revision" : "f455c2975872ccd2d9c81594c658af65716e9b9a", + "version" : "5.9.1" + } + }, + { + "identity" : "combine-schedulers", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/combine-schedulers", + "state" : { + "revision" : "9fa31f4403da54855f1e2aeaeff478f4f0e40b13", + "version" : "1.0.2" + } + }, + { + "identity" : "lottie-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/airbnb/lottie-ios.git", + "state" : { + "revision" : "fe4c6fe3a0aa66cdeb51d549623c82ca9704b9a5", + "version" : "4.5.0" + } + }, + { + "identity" : "swift-case-paths", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-case-paths", + "state" : { + "revision" : "71344dd930fde41e8f3adafe260adcbb2fc2a3dc", + "version" : "1.5.4" + } + }, + { + "identity" : "swift-clocks", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-clocks", + "state" : { + "revision" : "b9b24b69e2adda099a1fa381cda1eeec272d5b53", + "version" : "1.0.5" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections", + "state" : { + "revision" : "9bf03ff58ce34478e66aaee630e491823326fd06", + "version" : "1.1.3" + } + }, + { + "identity" : "swift-composable-architecture", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-composable-architecture.git", + "state" : { + "revision" : "0d8980f5bcc5fe6941f1788758667ff2b8c10f03", + "version" : "1.14.0" + } + }, + { + "identity" : "swift-concurrency-extras", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-concurrency-extras", + "state" : { + "revision" : "bb5059bde9022d69ac516803f4f227d8ac967f71", + "version" : "1.1.0" + } + }, + { + "identity" : "swift-custom-dump", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-custom-dump", + "state" : { + "revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1", + "version" : "1.3.3" + } + }, + { + "identity" : "swift-dependencies", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-dependencies", + "state" : { + "revision" : "3ef38bb702a1a2f39c7e19fc0578403b8ee52b17", + "version" : "1.3.9" + } + }, + { + "identity" : "swift-identified-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-identified-collections", + "state" : { + "revision" : "2f5ab6e091dd032b63dacbda052405756010dc3b", + "version" : "1.1.0" + } + }, + { + "identity" : "swift-navigation", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-navigation", + "state" : { + "revision" : "e834b3760731160d7d448509ee6a1408c8582a6b", + "version" : "2.2.0" + } + }, + { + "identity" : "swift-perception", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-perception", + "state" : { + "revision" : "bc67aa8e461351c97282c2419153757a446ae1c9", + "version" : "1.3.5" + } + }, + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swiftlang/swift-syntax", + "state" : { + "revision" : "515f79b522918f83483068d99c68daeb5116342d", + "version" : "600.0.0-prerelease-2024-08-20" + } + }, + { + "identity" : "swinject", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Swinject/Swinject", + "state" : { + "revision" : "be9dbcc7b86811bc131539a20c6f9c2d3e56919f", + "version" : "2.9.1" + } + }, + { + "identity" : "xctest-dynamic-overlay", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", + "state" : { + "revision" : "96beb108a57f24c8476ae1f309239270772b2940", + "version" : "1.2.5" + } + } + ], + "version" : 2 +} From dd8d41217b0d1802ba78450e4b10be2cd616eddc Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Thu, 29 Aug 2024 15:19:03 +0900 Subject: [PATCH 06/16] :sparkles: :: add MainFeature --- .../ModulePaths.swift | 3 +++ .../Example/Resources/LaunchScreen.storyboard | 21 ++++++++++++++++ .../Example/Sources/AppDelegate.swift | 1 + Projects/Feature/MainFeature/Project.swift | 24 +++++++++++++------ .../Feature/MainFeature/Sources/Sources.swift | 1 + .../Feature/MainFeature/Tests/Tests.swift | 2 ++ .../WeeklyForecastFeature/Project.swift | 8 +++++++ .../Sources/Sources.swift | 8 +++++++ .../WeeklyForecastFeature/Tests/Tests.swift | 8 +++++++ Tuist/Package.swift | 6 +++-- 10 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 Projects/Feature/MainFeature/Example/Resources/LaunchScreen.storyboard create mode 100644 Projects/Feature/MainFeature/Example/Sources/AppDelegate.swift create mode 100644 Projects/Feature/MainFeature/Sources/Sources.swift create mode 100644 Projects/Feature/MainFeature/Tests/Tests.swift create mode 100644 Projects/Feature/WeeklyForecastFeature/Project.swift create mode 100644 Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift create mode 100644 Projects/Feature/WeeklyForecastFeature/Tests/Tests.swift diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift index 7497731..04da508 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift @@ -25,6 +25,9 @@ public extension ModulePaths { enum Feature: String, ModularTargetPathConvertable { case BaseFeature case MainTabFeature + case MainFeature + case WeeklyForecastFeature + case SettingFeature } } diff --git a/Projects/Feature/MainFeature/Example/Resources/LaunchScreen.storyboard b/Projects/Feature/MainFeature/Example/Resources/LaunchScreen.storyboard new file mode 100644 index 0000000..8d8c83a --- /dev/null +++ b/Projects/Feature/MainFeature/Example/Resources/LaunchScreen.storyboard @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/Feature/MainFeature/Example/Sources/AppDelegate.swift b/Projects/Feature/MainFeature/Example/Sources/AppDelegate.swift new file mode 100644 index 0000000..9f44cbf --- /dev/null +++ b/Projects/Feature/MainFeature/Example/Sources/AppDelegate.swift @@ -0,0 +1 @@ +// This is For Tuist diff --git a/Projects/Feature/MainFeature/Project.swift b/Projects/Feature/MainFeature/Project.swift index 03faed8..0ab7864 100644 --- a/Projects/Feature/MainFeature/Project.swift +++ b/Projects/Feature/MainFeature/Project.swift @@ -1,8 +1,18 @@ -// -// Project.swift -// AppManifests -// -// Created by 정윤서 on 8/29/24. -// +import DependencyPlugin +import ProjectDescription +import ProjectDescriptionHelpers -import Foundation +let project = Project.module( + name: ModulePaths.Feature.MainFeature.rawValue, + targets: [ + .implements(module: .feature(.MainFeature), dependencies: [ + .feature(target: .BaseFeature) + ]), + .tests(module: .feature(.MainFeature), dependencies: [ + .feature(target: .MainFeature) + ]), + .example(module: .feature(.MainFeature), dependencies: [ + .feature(target: .MainFeature) + ]) + ] +) diff --git a/Projects/Feature/MainFeature/Sources/Sources.swift b/Projects/Feature/MainFeature/Sources/Sources.swift new file mode 100644 index 0000000..b1853ce --- /dev/null +++ b/Projects/Feature/MainFeature/Sources/Sources.swift @@ -0,0 +1 @@ +// This is for Tuist diff --git a/Projects/Feature/MainFeature/Tests/Tests.swift b/Projects/Feature/MainFeature/Tests/Tests.swift new file mode 100644 index 0000000..3c1e23b --- /dev/null +++ b/Projects/Feature/MainFeature/Tests/Tests.swift @@ -0,0 +1,2 @@ +// This is For Tuist + diff --git a/Projects/Feature/WeeklyForecastFeature/Project.swift b/Projects/Feature/WeeklyForecastFeature/Project.swift new file mode 100644 index 0000000..03faed8 --- /dev/null +++ b/Projects/Feature/WeeklyForecastFeature/Project.swift @@ -0,0 +1,8 @@ +// +// Project.swift +// AppManifests +// +// Created by 정윤서 on 8/29/24. +// + +import Foundation diff --git a/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift b/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift new file mode 100644 index 0000000..84a7e43 --- /dev/null +++ b/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift @@ -0,0 +1,8 @@ +// +// Sources.swift +// AppManifests +// +// Created by 정윤서 on 8/29/24. +// + +import Foundation diff --git a/Projects/Feature/WeeklyForecastFeature/Tests/Tests.swift b/Projects/Feature/WeeklyForecastFeature/Tests/Tests.swift new file mode 100644 index 0000000..d4441f4 --- /dev/null +++ b/Projects/Feature/WeeklyForecastFeature/Tests/Tests.swift @@ -0,0 +1,8 @@ +// +// Tests.swift +// AppManifests +// +// Created by 정윤서 on 8/29/24. +// + +import Foundation diff --git a/Tuist/Package.swift b/Tuist/Package.swift index 7bde62d..7173a8c 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -3,13 +3,15 @@ import PackageDescription #if TUIST import ProjectDescription + import ProjectDescriptionHelpers let packageSettings = PackageSettings( productTypes: [:], baseSettings: .settings( configurations: [ - .debug(name: .debug), - .release(name: .release) + .debug(name: .dev), + .debug(name: .stage), + .release(name: .prod) ] ) ) From 6a01c018fed92dc18740b041374799fd8b63789a Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Thu, 29 Aug 2024 15:19:52 +0900 Subject: [PATCH 07/16] :sparkles: :: add WeeklyForecaseFeature --- Projects/Feature/MainTabFeature/Project.swift | 4 +++- .../Example/Resources/LaunchScreen.storyboard | 21 ++++++++++++++++ .../Example/Sources/AppDelegate.swift | 1 + .../WeeklyForecastFeature/Project.swift | 24 +++++++++++++------ .../Sources/Sources.swift | 9 +------ .../WeeklyForecastFeature/Tests/Tests.swift | 9 +------ 6 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 Projects/Feature/WeeklyForecastFeature/Example/Resources/LaunchScreen.storyboard create mode 100644 Projects/Feature/WeeklyForecastFeature/Example/Sources/AppDelegate.swift diff --git a/Projects/Feature/MainTabFeature/Project.swift b/Projects/Feature/MainTabFeature/Project.swift index a2b6e11..c758660 100644 --- a/Projects/Feature/MainTabFeature/Project.swift +++ b/Projects/Feature/MainTabFeature/Project.swift @@ -6,7 +6,9 @@ let project = Project.module( name: ModulePaths.Feature.MainTabFeature.rawValue, targets: [ .implements(module: .feature(.MainTabFeature), dependencies: [ - .feature(target: .BaseFeature) + .feature(target: .BaseFeature), + .feature(target: .MainFeature), + .feature(target: .WeeklyForecastFeature) ]), .tests(module: .feature(.MainTabFeature), dependencies: []) ] diff --git a/Projects/Feature/WeeklyForecastFeature/Example/Resources/LaunchScreen.storyboard b/Projects/Feature/WeeklyForecastFeature/Example/Resources/LaunchScreen.storyboard new file mode 100644 index 0000000..8d8c83a --- /dev/null +++ b/Projects/Feature/WeeklyForecastFeature/Example/Resources/LaunchScreen.storyboard @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/Feature/WeeklyForecastFeature/Example/Sources/AppDelegate.swift b/Projects/Feature/WeeklyForecastFeature/Example/Sources/AppDelegate.swift new file mode 100644 index 0000000..9f44cbf --- /dev/null +++ b/Projects/Feature/WeeklyForecastFeature/Example/Sources/AppDelegate.swift @@ -0,0 +1 @@ +// This is For Tuist diff --git a/Projects/Feature/WeeklyForecastFeature/Project.swift b/Projects/Feature/WeeklyForecastFeature/Project.swift index 03faed8..1028a20 100644 --- a/Projects/Feature/WeeklyForecastFeature/Project.swift +++ b/Projects/Feature/WeeklyForecastFeature/Project.swift @@ -1,8 +1,18 @@ -// -// Project.swift -// AppManifests -// -// Created by 정윤서 on 8/29/24. -// +import DependencyPlugin +import ProjectDescription +import ProjectDescriptionHelpers -import Foundation +let project = Project.module( + name: ModulePaths.Feature.WeeklyForecastFeature.rawValue, + targets: [ + .implements(module: .feature(.WeeklyForecastFeature), dependencies: [ + .feature(target: .BaseFeature) + ]), + .tests(module: .feature(.WeeklyForecastFeature), dependencies: [ + .feature(target: .WeeklyForecastFeature) + ]), + .example(module: .feature(.WeeklyForecastFeature), dependencies: [ + .feature(target: .WeeklyForecastFeature) + ]) + ] +) diff --git a/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift b/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift index 84a7e43..9f44cbf 100644 --- a/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift +++ b/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift @@ -1,8 +1 @@ -// -// Sources.swift -// AppManifests -// -// Created by 정윤서 on 8/29/24. -// - -import Foundation +// This is For Tuist diff --git a/Projects/Feature/WeeklyForecastFeature/Tests/Tests.swift b/Projects/Feature/WeeklyForecastFeature/Tests/Tests.swift index d4441f4..9f44cbf 100644 --- a/Projects/Feature/WeeklyForecastFeature/Tests/Tests.swift +++ b/Projects/Feature/WeeklyForecastFeature/Tests/Tests.swift @@ -1,8 +1 @@ -// -// Tests.swift -// AppManifests -// -// Created by 정윤서 on 8/29/24. -// - -import Foundation +// This is For Tuist From 27e83499023fc13ede1b1c55330e76e43b0ec9c4 Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Thu, 29 Aug 2024 15:22:16 +0900 Subject: [PATCH 08/16] :sparkles: :: add SettingFeature --- Projects/Feature/MainTabFeature/Project.swift | 3 ++- .../Example/Resources/LaunchScreen.storyboard | 21 +++++++++++++++++++ .../Example/Sources/AppDelegate.swift | 1 + Projects/Feature/SettingFeature/Project.swift | 18 ++++++++++++++++ .../SettingFeature/Sources/Sources.swift | 1 + .../Feature/SettingFeature/Tests/Tests.swift | 1 + 6 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Projects/Feature/SettingFeature/Example/Resources/LaunchScreen.storyboard create mode 100644 Projects/Feature/SettingFeature/Example/Sources/AppDelegate.swift create mode 100644 Projects/Feature/SettingFeature/Project.swift create mode 100644 Projects/Feature/SettingFeature/Sources/Sources.swift create mode 100644 Projects/Feature/SettingFeature/Tests/Tests.swift diff --git a/Projects/Feature/MainTabFeature/Project.swift b/Projects/Feature/MainTabFeature/Project.swift index c758660..3dc6ed1 100644 --- a/Projects/Feature/MainTabFeature/Project.swift +++ b/Projects/Feature/MainTabFeature/Project.swift @@ -8,7 +8,8 @@ let project = Project.module( .implements(module: .feature(.MainTabFeature), dependencies: [ .feature(target: .BaseFeature), .feature(target: .MainFeature), - .feature(target: .WeeklyForecastFeature) + .feature(target: .WeeklyForecastFeature), + .feature(target: .SettingFeature) ]), .tests(module: .feature(.MainTabFeature), dependencies: []) ] diff --git a/Projects/Feature/SettingFeature/Example/Resources/LaunchScreen.storyboard b/Projects/Feature/SettingFeature/Example/Resources/LaunchScreen.storyboard new file mode 100644 index 0000000..8d8c83a --- /dev/null +++ b/Projects/Feature/SettingFeature/Example/Resources/LaunchScreen.storyboard @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/Feature/SettingFeature/Example/Sources/AppDelegate.swift b/Projects/Feature/SettingFeature/Example/Sources/AppDelegate.swift new file mode 100644 index 0000000..9f44cbf --- /dev/null +++ b/Projects/Feature/SettingFeature/Example/Sources/AppDelegate.swift @@ -0,0 +1 @@ +// This is For Tuist diff --git a/Projects/Feature/SettingFeature/Project.swift b/Projects/Feature/SettingFeature/Project.swift new file mode 100644 index 0000000..c6a4e31 --- /dev/null +++ b/Projects/Feature/SettingFeature/Project.swift @@ -0,0 +1,18 @@ +import DependencyPlugin +import ProjectDescription +import ProjectDescriptionHelpers + +let project = Project.module( + name: ModulePaths.Feature.SettingFeature.rawValue, + targets: [ + .implements(module: .feature(.SettingFeature), dependencies: [ + .feature(target: .BaseFeature) + ]), + .tests(module: .feature(.SettingFeature), dependencies: [ + .feature(target: .SettingFeature) + ]), + .example(module: .feature(.SettingFeature), dependencies: [ + .feature(target: .SettingFeature) + ]) + ] +) diff --git a/Projects/Feature/SettingFeature/Sources/Sources.swift b/Projects/Feature/SettingFeature/Sources/Sources.swift new file mode 100644 index 0000000..9f44cbf --- /dev/null +++ b/Projects/Feature/SettingFeature/Sources/Sources.swift @@ -0,0 +1 @@ +// This is For Tuist diff --git a/Projects/Feature/SettingFeature/Tests/Tests.swift b/Projects/Feature/SettingFeature/Tests/Tests.swift new file mode 100644 index 0000000..9f44cbf --- /dev/null +++ b/Projects/Feature/SettingFeature/Tests/Tests.swift @@ -0,0 +1 @@ +// This is For Tuist From 63531bb12ccee70a2becc0fd87af076abff5d07d Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Mon, 9 Sep 2024 22:55:58 +0900 Subject: [PATCH 09/16] :heavy_minus_sign: Swinject --- .../MainFeature/Sources/MainCore.swift | 20 +++++++ .../MainFeature/Sources/MainView.swift | 15 +++++ .../MainTabFeature/Sources/Enum/TabFlow.swift | 7 +++ .../MainTabFeature/Sources/MainTabCore.swift | 32 +++++++++++ .../MainTabFeature/Sources/MainTabView.swift | 55 +++++++++++++++++++ .../SettingFeature/Sources/SettingCore.swift | 15 +++++ .../SettingFeature/Sources/SettingView.swift | 14 +++++ .../Sources/WeeklyForecastCore.swift | 17 ++++++ .../Sources/WeeklyForecastView.swift | 14 +++++ .../Calendar.imageset/Contents.json | 23 ++++++++ .../Calendar.imageset/Frame 84.svg | 5 ++ .../Calendar.imageset/Frame 85.svg | 5 ++ .../Calendar.imageset/Frame 86.svg | 5 ++ .../Icons/Icons.xcassets/Contents.json | 6 ++ .../Home.imageset/Contents.json | 23 ++++++++ .../Icons.xcassets/Home.imageset/Frame 83.svg | 3 + .../Icons.xcassets/Home.imageset/Frame 84.svg | 3 + .../Icons.xcassets/Home.imageset/Frame 85.svg | 3 + .../Setting.imageset/Contents.json | 23 ++++++++ .../Setting.imageset/Frame 83.svg | 3 + .../Setting.imageset/Frame 84.svg | 3 + .../Setting.imageset/Frame 85.svg | 3 + Tuist/Package.resolved | 9 --- Tuist/Package.swift | 3 +- 24 files changed, 298 insertions(+), 11 deletions(-) create mode 100644 Projects/Feature/MainFeature/Sources/MainCore.swift create mode 100644 Projects/Feature/MainFeature/Sources/MainView.swift create mode 100644 Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift create mode 100644 Projects/Feature/MainTabFeature/Sources/MainTabCore.swift create mode 100644 Projects/Feature/MainTabFeature/Sources/MainTabView.swift create mode 100644 Projects/Feature/SettingFeature/Sources/SettingCore.swift create mode 100644 Projects/Feature/SettingFeature/Sources/SettingView.swift create mode 100644 Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift create mode 100644 Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Contents.json create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 84.svg create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 85.svg create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 86.svg create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Contents.json create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Contents.json create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 83.svg create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 84.svg create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 85.svg create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Contents.json create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 83.svg create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 84.svg create mode 100644 Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 85.svg diff --git a/Projects/Feature/MainFeature/Sources/MainCore.swift b/Projects/Feature/MainFeature/Sources/MainCore.swift new file mode 100644 index 0000000..fbd4a21 --- /dev/null +++ b/Projects/Feature/MainFeature/Sources/MainCore.swift @@ -0,0 +1,20 @@ +import ComposableArchitecture +import Foundation + +public struct MainCore: Reducer { + public init() {} + public struct State: Equatable { + public init() {} + } + + public enum Action: Equatable {} + + public var body: some Reducer { + Reduce { state, action in + switch action { + default: + return .none + } + } + } +} diff --git a/Projects/Feature/MainFeature/Sources/MainView.swift b/Projects/Feature/MainFeature/Sources/MainView.swift new file mode 100644 index 0000000..d86c4ec --- /dev/null +++ b/Projects/Feature/MainFeature/Sources/MainView.swift @@ -0,0 +1,15 @@ +import ComposableArchitecture +import DesignSystem +import SwiftUI + +public struct MainView: View { + let store: StoreOf + + public init(store: StoreOf) { + self.store = store + } + + public var body: some View { + Text("Main View") + } +} diff --git a/Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift b/Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift new file mode 100644 index 0000000..0f1cf39 --- /dev/null +++ b/Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift @@ -0,0 +1,7 @@ +import Foundation + +public enum TabFlow: String { + case main = "대시보드" + case weekly = "주간 예보" + case setting = "설정" +} diff --git a/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift b/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift new file mode 100644 index 0000000..c7114f5 --- /dev/null +++ b/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift @@ -0,0 +1,32 @@ +import ComposableArchitecture +import MainFeature +import SettingFeature +import WeeklyForecastFeature + +public struct MainTabCore: Reducer { + public init() {} + public struct State: Equatable { + var mainCore: MainCore.State + var weeklyCore: WeeklyForecastCore.State + var settingCore: SettingCore.State + + public init() { self = .init() } + } + + public enum Action { + case changeTabFlow(TabFlow) + case mainCore(MainCore.Action) + case weeklyCore(WeeklyForecastCore.Action) + case settingCore(SettingCore.Action) + } + + public var body: some Reducer { + Reduce { state, action in + switch action { + default: + return .none + } + return .none + } + } +} diff --git a/Projects/Feature/MainTabFeature/Sources/MainTabView.swift b/Projects/Feature/MainTabFeature/Sources/MainTabView.swift new file mode 100644 index 0000000..ca341c8 --- /dev/null +++ b/Projects/Feature/MainTabFeature/Sources/MainTabView.swift @@ -0,0 +1,55 @@ +import ComposableArchitecture +import MainFeature +import SettingFeature +import WeeklyForecastFeature +import DesignSystem +import SwiftUI + +public struct MainTabView: View { + let store: StoreOf + + public init(store: StoreOf) { + self.store = store + } + + public var body: some View { + WithViewStore(self.store, observe: { $0 }) { viewStore in + TabView { + MainView(store: store.scope( + state: \.mainCore, + action: MainTabCore.Action.mainCore) + ) + .tag(TabFlow.main) + .tabItem { + ODIcon(.home) + + Text("대시보드") + .font(.medium(.system, size: .text3)) + } + + WeeklyForecastView(store: store.scope( + state: \.weeklyCore, + action: MainTabCore.Action.weeklyCore)) + .tag(TabFlow.weekly) + .tabItem { + ODIcon(.calendar) + + Text("주간 예보") + .font(.medium(.system, size: .text3)) + } + + SettingView(store: store.scope( + state: \.settingCore, + action: MainTabCore.Action.settingCore) + ) + .tag(TabFlow.setting) + .tabItem { + ODIcon(.setting) + + Text("설정") + .font(.medium(.system, size: .text3)) + } + } + } + } +} diff --git a/Projects/Feature/SettingFeature/Sources/SettingCore.swift b/Projects/Feature/SettingFeature/Sources/SettingCore.swift new file mode 100644 index 0000000..b348de8 --- /dev/null +++ b/Projects/Feature/SettingFeature/Sources/SettingCore.swift @@ -0,0 +1,15 @@ +import ComposableArchitecture +import Foundation + +public struct SettingCore: Reducer { + public init() {} + public struct State: Equatable { + + } + + public enum Action: Equatable { + + } + + public func reduce(into state: inout State, action: Action) -> Effect {} +} diff --git a/Projects/Feature/SettingFeature/Sources/SettingView.swift b/Projects/Feature/SettingFeature/Sources/SettingView.swift new file mode 100644 index 0000000..b8ea251 --- /dev/null +++ b/Projects/Feature/SettingFeature/Sources/SettingView.swift @@ -0,0 +1,14 @@ +import ComposableArchitecture +import SwiftUI + +public struct SettingView: View { + let store: StoreOf + + public init(store: StoreOf) { + self.store = store + } + + public var body: some View { + Text("Setting View") + } +} diff --git a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift new file mode 100644 index 0000000..038f697 --- /dev/null +++ b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift @@ -0,0 +1,17 @@ +import ComposableArchitecture +import Foundation + +public struct WeeklyForecastCore: Reducer { + public init() {} + public struct State: Equatable { + + } + + public enum Action: Equatable { + + } + + public func reduce(into state: inout State, action: Action) -> Effect { + + } +} diff --git a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift new file mode 100644 index 0000000..34a3e5e --- /dev/null +++ b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift @@ -0,0 +1,14 @@ +import ComposableArchitecture +import SwiftUI + +public struct WeeklyForecastView: View { + let store: StoreOf + + public init(store: StoreOf) { + self.store = store + } + + public var body: some View { + Text("Weekly") + } +} diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Contents.json b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Contents.json new file mode 100644 index 0000000..3232a77 --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Frame 86.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame 84.svg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame 85.svg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 84.svg b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 84.svg new file mode 100644 index 0000000..8255838 --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 84.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 85.svg b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 85.svg new file mode 100644 index 0000000..8255838 --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 85.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 86.svg b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 86.svg new file mode 100644 index 0000000..8255838 --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Calendar.imageset/Frame 86.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Contents.json b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Contents.json b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Contents.json new file mode 100644 index 0000000..132abae --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Frame 84.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame 83.svg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame 85.svg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 83.svg b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 83.svg new file mode 100644 index 0000000..8275b17 --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 83.svg @@ -0,0 +1,3 @@ + + + diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 84.svg b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 84.svg new file mode 100644 index 0000000..8275b17 --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 84.svg @@ -0,0 +1,3 @@ + + + diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 85.svg b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 85.svg new file mode 100644 index 0000000..8275b17 --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Home.imageset/Frame 85.svg @@ -0,0 +1,3 @@ + + + diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Contents.json b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Contents.json new file mode 100644 index 0000000..132abae --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Frame 84.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame 83.svg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame 85.svg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 83.svg b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 83.svg new file mode 100644 index 0000000..20ef6ce --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 83.svg @@ -0,0 +1,3 @@ + + + diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 84.svg b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 84.svg new file mode 100644 index 0000000..20ef6ce --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 84.svg @@ -0,0 +1,3 @@ + + + diff --git a/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 85.svg b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 85.svg new file mode 100644 index 0000000..20ef6ce --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Icons/Icons.xcassets/Setting.imageset/Frame 85.svg @@ -0,0 +1,3 @@ + + + diff --git a/Tuist/Package.resolved b/Tuist/Package.resolved index d3e2614..c03a9dd 100644 --- a/Tuist/Package.resolved +++ b/Tuist/Package.resolved @@ -126,15 +126,6 @@ "version" : "600.0.0-prerelease-2024-08-20" } }, - { - "identity" : "swinject", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Swinject/Swinject", - "state" : { - "revision" : "be9dbcc7b86811bc131539a20c6f9c2d3e56919f", - "version" : "2.9.1" - } - }, { "identity" : "xctest-dynamic-overlay", "kind" : "remoteSourceControl", diff --git a/Tuist/Package.swift b/Tuist/Package.swift index 7173a8c..75da018 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -22,7 +22,6 @@ let package = Package( dependencies: [ .package(url: "https://github.com/pointfreeco/swift-composable-architecture.git", from: "1.14.0"), .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.9.1")), - .package(url: "https://github.com/airbnb/lottie-ios.git", .upToNextMajor(from: "4.5.0")), - .package(url: "https://github.com/Swinject/Swinject.git", .upToNextMajor(from: "2.9.1")) + .package(url: "https://github.com/airbnb/lottie-ios.git", .upToNextMajor(from: "4.5.0")) ] ) From 8e3840de95850d897edb1d3571672a934904acdc Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Tue, 10 Sep 2024 23:48:30 +0900 Subject: [PATCH 10/16] :fire: :: Remove Widget Target --- .../Dependency+SPM.swift | 1 - .../ModulePaths.swift | 1 + Projects/App/Project.swift | 21 +--- .../AccentColor.colorset/Contents.json | 11 --- .../AppIcon.appiconset/Contents.json | 98 ------------------- .../Resources/Assets.xcassets/Contents.json | 6 -- .../Resources/LaunchScreen.storyboard | 25 ----- .../Application/OndoseeIOSWidgetApp.swift | 10 -- Projects/App/iOS-Widget/Support/Info.plist | 62 ------------ .../Support/ondoseeWidget.entitlements | 0 Projects/Feature/BaseFeature/Project.swift | 3 +- 11 files changed, 4 insertions(+), 234 deletions(-) delete mode 100644 Projects/App/iOS-Widget/Resources/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 Projects/App/iOS-Widget/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 Projects/App/iOS-Widget/Resources/Assets.xcassets/Contents.json delete mode 100644 Projects/App/iOS-Widget/Resources/LaunchScreen.storyboard delete mode 100644 Projects/App/iOS-Widget/Sources/Application/OndoseeIOSWidgetApp.swift delete mode 100644 Projects/App/iOS-Widget/Support/Info.plist delete mode 100644 Projects/App/iOS-Widget/Support/ondoseeWidget.entitlements diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift index 85c53ff..cb97806 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift @@ -8,7 +8,6 @@ public extension TargetDependency.SPM { static let ComposableArchitecture = TargetDependency.external(name: "ComposableArchitecture") static let Alamofire = TargetDependency.external(name: "Alamofire") static let Lottie = TargetDependency.external(name: "Lottie") - static let Swinject = TargetDependency.external(name: "Swinject") } public extension Package { diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift index 04da508..9474b4d 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift @@ -28,6 +28,7 @@ public extension ModulePaths { case MainFeature case WeeklyForecastFeature case SettingFeature + case RootFeature } } diff --git a/Projects/App/Project.swift b/Projects/App/Project.swift index a4db5bc..f341168 100644 --- a/Projects/App/Project.swift +++ b/Projects/App/Project.swift @@ -33,29 +33,12 @@ let targets: [Target] = [ + ModulePaths.Domain.allCases.map { TargetDependency.domain(target: $0) } + [ - .core(target: .Networking), - .target(name: "\(env.name)Widget") + .core(target: .Networking) ], settings: .settings( base: env.baseSetting ) - ), - .target( - name: "\(env.name)Widget", - destinations: [.iPhone, .iPad], - product: .appExtension, - bundleId: "\(env.organizationName).\(env.name).ondoseeWidget", - deploymentTargets: .iOS("16.0"), - infoPlist: .file(path: "iOS-Widget/Support/Info.plist"), - sources: ["iOS-Widget/Sources/**"], - resources: ["iOS-Widget/Resources/**"], - entitlements: .file(path: "iOS-Widget/Support/ondoseeWidget.entitlements"), - scripts: scripts, - dependencies: [ - .userInterface(target: .DesignSystem) - ], - settings: settings - ), + ) ] let schemes: [Scheme] = [ diff --git a/Projects/App/iOS-Widget/Resources/Assets.xcassets/AccentColor.colorset/Contents.json b/Projects/App/iOS-Widget/Resources/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb87897..0000000 --- a/Projects/App/iOS-Widget/Resources/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Projects/App/iOS-Widget/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/Projects/App/iOS-Widget/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 9221b9b..0000000 --- a/Projects/App/iOS-Widget/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Projects/App/iOS-Widget/Resources/Assets.xcassets/Contents.json b/Projects/App/iOS-Widget/Resources/Assets.xcassets/Contents.json deleted file mode 100644 index 73c0059..0000000 --- a/Projects/App/iOS-Widget/Resources/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Projects/App/iOS-Widget/Resources/LaunchScreen.storyboard b/Projects/App/iOS-Widget/Resources/LaunchScreen.storyboard deleted file mode 100644 index 865e932..0000000 --- a/Projects/App/iOS-Widget/Resources/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Projects/App/iOS-Widget/Sources/Application/OndoseeIOSWidgetApp.swift b/Projects/App/iOS-Widget/Sources/Application/OndoseeIOSWidgetApp.swift deleted file mode 100644 index e1de425..0000000 --- a/Projects/App/iOS-Widget/Sources/Application/OndoseeIOSWidgetApp.swift +++ /dev/null @@ -1,10 +0,0 @@ -import SwiftUI - -@main -struct OndoseeIOSWidgetApp: App { - var body: some Scene { - WindowGroup { - EmptyView() - } - } -} diff --git a/Projects/App/iOS-Widget/Support/Info.plist b/Projects/App/iOS-Widget/Support/Info.plist deleted file mode 100644 index 2688b32..0000000 --- a/Projects/App/iOS-Widget/Support/Info.plist +++ /dev/null @@ -1,62 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - - - - - UIApplicationSupportsIndirectInputEvents - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Projects/App/iOS-Widget/Support/ondoseeWidget.entitlements b/Projects/App/iOS-Widget/Support/ondoseeWidget.entitlements deleted file mode 100644 index e69de29..0000000 diff --git a/Projects/Feature/BaseFeature/Project.swift b/Projects/Feature/BaseFeature/Project.swift index a6d72f4..1aca02b 100644 --- a/Projects/Feature/BaseFeature/Project.swift +++ b/Projects/Feature/BaseFeature/Project.swift @@ -11,8 +11,7 @@ let project = Project.module( .feature(target: .BaseFeature, type: .interface), .userInterface(target: .DesignSystem), .shared(target: .GlobalThirdPartyLibrary), - .SPM.ComposableArchitecture, - .SPM.Swinject + .SPM.ComposableArchitecture ]), .tests(module: .feature(.BaseFeature), dependencies: [ .feature(target: .BaseFeature) From 4f07e713953d60c203ff643d71f30e9f7136a6ef Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Tue, 10 Sep 2024 23:49:01 +0900 Subject: [PATCH 11/16] :memo: :: update SwiftLint.yml --- Scripts/.swiftlint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scripts/.swiftlint.yml b/Scripts/.swiftlint.yml index 0d13280..1d838dc 100644 --- a/Scripts/.swiftlint.yml +++ b/Scripts/.swiftlint.yml @@ -2,6 +2,9 @@ excluded: - fastlane - Dependencies - ondosee + - Tuist + - Plugin + - Scripts disabled_rules: - void_function_in_ternary From 78b3c6d09cd8e7f47b8fcd3d53c60dff6893435e Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Tue, 10 Sep 2024 23:50:19 +0900 Subject: [PATCH 12/16] :sparkles: :: setting base View --- .../MainFeature/Sources/MainCore.swift | 2 + .../MainFeature/Sources/MainView.swift | 13 ++++- .../Feature/MainFeature/Sources/Sources.swift | 1 - .../MainTabFeature/Sources/Enum/TabFlow.swift | 8 +-- .../MainTabFeature/Sources/MainTabCore.swift | 24 +++++---- .../MainTabFeature/Sources/MainTabView.swift | 51 +++++++++++-------- .../MainTabFeature/Sources/Sources.swift | 2 - .../SettingFeature/Sources/SettingCore.swift | 3 +- .../SettingFeature/Sources/Sources.swift | 1 - .../Sources/Sources.swift | 1 - .../Sources/WeeklyForecastCore.swift | 12 +++-- .../Sources/WeeklyForecastView.swift | 13 ++++- 12 files changed, 84 insertions(+), 47 deletions(-) delete mode 100644 Projects/Feature/MainFeature/Sources/Sources.swift delete mode 100644 Projects/Feature/MainTabFeature/Sources/Sources.swift delete mode 100644 Projects/Feature/SettingFeature/Sources/Sources.swift delete mode 100644 Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift diff --git a/Projects/Feature/MainFeature/Sources/MainCore.swift b/Projects/Feature/MainFeature/Sources/MainCore.swift index fbd4a21..2252839 100644 --- a/Projects/Feature/MainFeature/Sources/MainCore.swift +++ b/Projects/Feature/MainFeature/Sources/MainCore.swift @@ -1,9 +1,11 @@ import ComposableArchitecture import Foundation +import DesignSystem public struct MainCore: Reducer { public init() {} public struct State: Equatable { + var weatherType: BackgroundType = .clear public init() {} } diff --git a/Projects/Feature/MainFeature/Sources/MainView.swift b/Projects/Feature/MainFeature/Sources/MainView.swift index d86c4ec..caabb42 100644 --- a/Projects/Feature/MainFeature/Sources/MainView.swift +++ b/Projects/Feature/MainFeature/Sources/MainView.swift @@ -10,6 +10,17 @@ public struct MainView: View { } public var body: some View { - Text("Main View") + WithViewStore(store, observe: { $0 }) { viewStore in + ZStack { + LinearGradient( + gradient: Gradient( + colors: viewStore.state.weatherType.toColors() + ), + startPoint: .top, + endPoint: .bottom + ) + } + .ignoresSafeArea() + } } } diff --git a/Projects/Feature/MainFeature/Sources/Sources.swift b/Projects/Feature/MainFeature/Sources/Sources.swift deleted file mode 100644 index b1853ce..0000000 --- a/Projects/Feature/MainFeature/Sources/Sources.swift +++ /dev/null @@ -1 +0,0 @@ -// This is for Tuist diff --git a/Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift b/Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift index 0f1cf39..438dc4c 100644 --- a/Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift +++ b/Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift @@ -1,7 +1,7 @@ import Foundation -public enum TabFlow: String { - case main = "대시보드" - case weekly = "주간 예보" - case setting = "설정" +public enum TabFlow { + case main + case weekly + case setting } diff --git a/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift b/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift index c7114f5..e7dfcd2 100644 --- a/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift +++ b/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift @@ -6,26 +6,28 @@ import WeeklyForecastFeature public struct MainTabCore: Reducer { public init() {} public struct State: Equatable { - var mainCore: MainCore.State - var weeklyCore: WeeklyForecastCore.State - var settingCore: SettingCore.State + public var tabFlow: TabFlow = .main + public var mainCore = MainCore.State() + public var weeklyCore = WeeklyForecastCore.State() + public var settingCore = SettingCore.State() - public init() { self = .init() } + public init() {} } - public enum Action { + public enum Action: Equatable { case changeTabFlow(TabFlow) case mainCore(MainCore.Action) case weeklyCore(WeeklyForecastCore.Action) case settingCore(SettingCore.Action) } - public var body: some Reducer { - Reduce { state, action in - switch action { - default: - return .none - } + public func reduce(into state: inout State, action: Action) -> Effect { + switch action { + case let .changeTabFlow(flow): + state.tabFlow = flow + return .none + + default: return .none } } diff --git a/Projects/Feature/MainTabFeature/Sources/MainTabView.swift b/Projects/Feature/MainTabFeature/Sources/MainTabView.swift index ca341c8..6d62311 100644 --- a/Projects/Feature/MainTabFeature/Sources/MainTabView.swift +++ b/Projects/Feature/MainTabFeature/Sources/MainTabView.swift @@ -10,46 +10,57 @@ public struct MainTabView: View { public init(store: StoreOf) { self.store = store + UITabBar.appearance().backgroundColor = .clear + UITabBar.appearance().scrollEdgeAppearance = .init() } public var body: some View { - WithViewStore(self.store, observe: { $0 }) { viewStore in - TabView { + WithViewStore(store, observe: { $0 }) { viewStore in + TabView(selection: viewStore.binding( + get: \.tabFlow, + send: MainTabCore.Action.changeTabFlow + )) { MainView(store: store.scope( - state: \.mainCore, - action: MainTabCore.Action.mainCore) - ) + state: \.mainCore, + action: MainTabCore.Action.mainCore + )) .tag(TabFlow.main) .tabItem { - ODIcon(.home) - - Text("대시보드") - .font(.medium(.system, size: .text3)) + tabBarItem(.home, text: "대시보드") } WeeklyForecastView(store: store.scope( state: \.weeklyCore, - action: MainTabCore.Action.weeklyCore)) + action: MainTabCore.Action.weeklyCore + )) .tag(TabFlow.weekly) .tabItem { - ODIcon(.calendar) - - Text("주간 예보") - .font(.medium(.system, size: .text3)) + tabBarItem(.calendar, text: "주간 예보") } SettingView(store: store.scope( state: \.settingCore, - action: MainTabCore.Action.settingCore) - ) + action: MainTabCore.Action.settingCore + )) .tag(TabFlow.setting) .tabItem { - ODIcon(.setting) - - Text("설정") - .font(.medium(.system, size: .text3)) + tabBarItem(.setting, text: "설정") } } + .accentColor(.ondosee(.system(.selected))) + } + } + + @ViewBuilder + func tabBarItem( + _ icon: ODIcon.Icon, + text: String + ) -> some View { + VStack(spacing: 4) { + ODIcon(icon) + + Text(text) + .font(.medium(.system, size: .text3)) } } } diff --git a/Projects/Feature/MainTabFeature/Sources/Sources.swift b/Projects/Feature/MainTabFeature/Sources/Sources.swift deleted file mode 100644 index 50ff8a0..0000000 --- a/Projects/Feature/MainTabFeature/Sources/Sources.swift +++ /dev/null @@ -1,2 +0,0 @@ -import SwiftUI - diff --git a/Projects/Feature/SettingFeature/Sources/SettingCore.swift b/Projects/Feature/SettingFeature/Sources/SettingCore.swift index b348de8..a718bf1 100644 --- a/Projects/Feature/SettingFeature/Sources/SettingCore.swift +++ b/Projects/Feature/SettingFeature/Sources/SettingCore.swift @@ -4,11 +4,10 @@ import Foundation public struct SettingCore: Reducer { public init() {} public struct State: Equatable { - + public init() {} } public enum Action: Equatable { - } public func reduce(into state: inout State, action: Action) -> Effect {} diff --git a/Projects/Feature/SettingFeature/Sources/Sources.swift b/Projects/Feature/SettingFeature/Sources/Sources.swift deleted file mode 100644 index 9f44cbf..0000000 --- a/Projects/Feature/SettingFeature/Sources/Sources.swift +++ /dev/null @@ -1 +0,0 @@ -// This is For Tuist diff --git a/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift b/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift deleted file mode 100644 index 9f44cbf..0000000 --- a/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift +++ /dev/null @@ -1 +0,0 @@ -// This is For Tuist diff --git a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift index 038f697..8cd1461 100644 --- a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift +++ b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift @@ -1,17 +1,23 @@ import ComposableArchitecture import Foundation +import DesignSystem public struct WeeklyForecastCore: Reducer { public init() {} public struct State: Equatable { - + var weatherType: BackgroundType = .clear + public init() {} } public enum Action: Equatable { - + case changeWeatherType(BackgroundType) } public func reduce(into state: inout State, action: Action) -> Effect { - + switch action { + case let .changeWeatherType(type): + state.weatherType = type + return .none + } } } diff --git a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift index 34a3e5e..5b8c575 100644 --- a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift +++ b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift @@ -9,6 +9,17 @@ public struct WeeklyForecastView: View { } public var body: some View { - Text("Weekly") + WithViewStore(store, observe: { $0 }) { viewStore in + ZStack { + LinearGradient( + gradient: Gradient( + colors: viewStore.state.weatherType.toColors() + ), + startPoint: .top, + endPoint: .bottom + ) + } + .ignoresSafeArea() + } } } From 8eadfc29c29f8de10c791ac3845590997e15b60f Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Tue, 10 Sep 2024 23:53:01 +0900 Subject: [PATCH 13/16] :sparkles: :: add MainTabFeature --- .../MainFeature/Sources/MainCore.swift | 2 - .../MainFeature/Sources/MainView.swift | 13 +---- .../Feature/MainFeature/Sources/Sources.swift | 1 + .../MainTabFeature/Sources/Enum/TabFlow.swift | 8 +-- .../MainTabFeature/Sources/MainTabCore.swift | 24 ++++----- .../MainTabFeature/Sources/MainTabView.swift | 51 ++++++++----------- .../MainTabFeature/Sources/Sources.swift | 2 + .../SettingFeature/Sources/SettingCore.swift | 3 +- .../SettingFeature/Sources/Sources.swift | 1 + .../Sources/Sources.swift | 1 + .../Sources/WeeklyForecastCore.swift | 12 ++--- .../Sources/WeeklyForecastView.swift | 13 +---- 12 files changed, 47 insertions(+), 84 deletions(-) create mode 100644 Projects/Feature/MainFeature/Sources/Sources.swift create mode 100644 Projects/Feature/MainTabFeature/Sources/Sources.swift create mode 100644 Projects/Feature/SettingFeature/Sources/Sources.swift create mode 100644 Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift diff --git a/Projects/Feature/MainFeature/Sources/MainCore.swift b/Projects/Feature/MainFeature/Sources/MainCore.swift index 2252839..fbd4a21 100644 --- a/Projects/Feature/MainFeature/Sources/MainCore.swift +++ b/Projects/Feature/MainFeature/Sources/MainCore.swift @@ -1,11 +1,9 @@ import ComposableArchitecture import Foundation -import DesignSystem public struct MainCore: Reducer { public init() {} public struct State: Equatable { - var weatherType: BackgroundType = .clear public init() {} } diff --git a/Projects/Feature/MainFeature/Sources/MainView.swift b/Projects/Feature/MainFeature/Sources/MainView.swift index caabb42..d86c4ec 100644 --- a/Projects/Feature/MainFeature/Sources/MainView.swift +++ b/Projects/Feature/MainFeature/Sources/MainView.swift @@ -10,17 +10,6 @@ public struct MainView: View { } public var body: some View { - WithViewStore(store, observe: { $0 }) { viewStore in - ZStack { - LinearGradient( - gradient: Gradient( - colors: viewStore.state.weatherType.toColors() - ), - startPoint: .top, - endPoint: .bottom - ) - } - .ignoresSafeArea() - } + Text("Main View") } } diff --git a/Projects/Feature/MainFeature/Sources/Sources.swift b/Projects/Feature/MainFeature/Sources/Sources.swift new file mode 100644 index 0000000..b1853ce --- /dev/null +++ b/Projects/Feature/MainFeature/Sources/Sources.swift @@ -0,0 +1 @@ +// This is for Tuist diff --git a/Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift b/Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift index 438dc4c..0f1cf39 100644 --- a/Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift +++ b/Projects/Feature/MainTabFeature/Sources/Enum/TabFlow.swift @@ -1,7 +1,7 @@ import Foundation -public enum TabFlow { - case main - case weekly - case setting +public enum TabFlow: String { + case main = "대시보드" + case weekly = "주간 예보" + case setting = "설정" } diff --git a/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift b/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift index e7dfcd2..c7114f5 100644 --- a/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift +++ b/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift @@ -6,28 +6,26 @@ import WeeklyForecastFeature public struct MainTabCore: Reducer { public init() {} public struct State: Equatable { - public var tabFlow: TabFlow = .main - public var mainCore = MainCore.State() - public var weeklyCore = WeeklyForecastCore.State() - public var settingCore = SettingCore.State() + var mainCore: MainCore.State + var weeklyCore: WeeklyForecastCore.State + var settingCore: SettingCore.State - public init() {} + public init() { self = .init() } } - public enum Action: Equatable { + public enum Action { case changeTabFlow(TabFlow) case mainCore(MainCore.Action) case weeklyCore(WeeklyForecastCore.Action) case settingCore(SettingCore.Action) } - public func reduce(into state: inout State, action: Action) -> Effect { - switch action { - case let .changeTabFlow(flow): - state.tabFlow = flow - return .none - - default: + public var body: some Reducer { + Reduce { state, action in + switch action { + default: + return .none + } return .none } } diff --git a/Projects/Feature/MainTabFeature/Sources/MainTabView.swift b/Projects/Feature/MainTabFeature/Sources/MainTabView.swift index 6d62311..ca341c8 100644 --- a/Projects/Feature/MainTabFeature/Sources/MainTabView.swift +++ b/Projects/Feature/MainTabFeature/Sources/MainTabView.swift @@ -10,57 +10,46 @@ public struct MainTabView: View { public init(store: StoreOf) { self.store = store - UITabBar.appearance().backgroundColor = .clear - UITabBar.appearance().scrollEdgeAppearance = .init() } public var body: some View { - WithViewStore(store, observe: { $0 }) { viewStore in - TabView(selection: viewStore.binding( - get: \.tabFlow, - send: MainTabCore.Action.changeTabFlow - )) { + WithViewStore(self.store, observe: { $0 }) { viewStore in + TabView { MainView(store: store.scope( - state: \.mainCore, - action: MainTabCore.Action.mainCore - )) + state: \.mainCore, + action: MainTabCore.Action.mainCore) + ) .tag(TabFlow.main) .tabItem { - tabBarItem(.home, text: "대시보드") + ODIcon(.home) + + Text("대시보드") + .font(.medium(.system, size: .text3)) } WeeklyForecastView(store: store.scope( state: \.weeklyCore, - action: MainTabCore.Action.weeklyCore - )) + action: MainTabCore.Action.weeklyCore)) .tag(TabFlow.weekly) .tabItem { - tabBarItem(.calendar, text: "주간 예보") + ODIcon(.calendar) + + Text("주간 예보") + .font(.medium(.system, size: .text3)) } SettingView(store: store.scope( state: \.settingCore, - action: MainTabCore.Action.settingCore - )) + action: MainTabCore.Action.settingCore) + ) .tag(TabFlow.setting) .tabItem { - tabBarItem(.setting, text: "설정") + ODIcon(.setting) + + Text("설정") + .font(.medium(.system, size: .text3)) } } - .accentColor(.ondosee(.system(.selected))) - } - } - - @ViewBuilder - func tabBarItem( - _ icon: ODIcon.Icon, - text: String - ) -> some View { - VStack(spacing: 4) { - ODIcon(icon) - - Text(text) - .font(.medium(.system, size: .text3)) } } } diff --git a/Projects/Feature/MainTabFeature/Sources/Sources.swift b/Projects/Feature/MainTabFeature/Sources/Sources.swift new file mode 100644 index 0000000..50ff8a0 --- /dev/null +++ b/Projects/Feature/MainTabFeature/Sources/Sources.swift @@ -0,0 +1,2 @@ +import SwiftUI + diff --git a/Projects/Feature/SettingFeature/Sources/SettingCore.swift b/Projects/Feature/SettingFeature/Sources/SettingCore.swift index a718bf1..b348de8 100644 --- a/Projects/Feature/SettingFeature/Sources/SettingCore.swift +++ b/Projects/Feature/SettingFeature/Sources/SettingCore.swift @@ -4,10 +4,11 @@ import Foundation public struct SettingCore: Reducer { public init() {} public struct State: Equatable { - public init() {} + } public enum Action: Equatable { + } public func reduce(into state: inout State, action: Action) -> Effect {} diff --git a/Projects/Feature/SettingFeature/Sources/Sources.swift b/Projects/Feature/SettingFeature/Sources/Sources.swift new file mode 100644 index 0000000..9f44cbf --- /dev/null +++ b/Projects/Feature/SettingFeature/Sources/Sources.swift @@ -0,0 +1 @@ +// This is For Tuist diff --git a/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift b/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift new file mode 100644 index 0000000..9f44cbf --- /dev/null +++ b/Projects/Feature/WeeklyForecastFeature/Sources/Sources.swift @@ -0,0 +1 @@ +// This is For Tuist diff --git a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift index 8cd1461..038f697 100644 --- a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift +++ b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift @@ -1,23 +1,17 @@ import ComposableArchitecture import Foundation -import DesignSystem public struct WeeklyForecastCore: Reducer { public init() {} public struct State: Equatable { - var weatherType: BackgroundType = .clear - public init() {} + } public enum Action: Equatable { - case changeWeatherType(BackgroundType) + } public func reduce(into state: inout State, action: Action) -> Effect { - switch action { - case let .changeWeatherType(type): - state.weatherType = type - return .none - } + } } diff --git a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift index 5b8c575..34a3e5e 100644 --- a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift +++ b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastView.swift @@ -9,17 +9,6 @@ public struct WeeklyForecastView: View { } public var body: some View { - WithViewStore(store, observe: { $0 }) { viewStore in - ZStack { - LinearGradient( - gradient: Gradient( - colors: viewStore.state.weatherType.toColors() - ), - startPoint: .top, - endPoint: .bottom - ) - } - .ignoresSafeArea() - } + Text("Weekly") } } From 53943d1fcb91bbf2c77d99cc4d6fa31ebaf01d09 Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Wed, 11 Sep 2024 11:07:00 +0900 Subject: [PATCH 14/16] :sparkles: :: setting TabView --- .../Sources/Application/OndoseeIOSApp.swift | 10 ++++- .../MainTabFeature/Sources/MainTabCore.swift | 15 +++++--- .../MainTabFeature/Sources/MainTabView.swift | 8 +++- .../MainTabFeature/Sources/Sources.swift | 2 - Projects/Feature/RootFeature/Project.swift | 16 ++++++++ .../RootFeature/Sources/RootCore.swift | 26 +++++++++++++ .../RootFeature/Sources/RootView.swift | 22 +++++++++++ .../Feature/RootFeature/Tests/Tests.swift | 1 + .../SettingFeature/Sources/SettingCore.swift | 2 +- .../Sources/WeeklyForecastCore.swift | 6 +-- .../Selected.colorset/Contents.json | 38 +++++++++++++++++++ .../Sources/Color/ODColorSystem+System.swift | 2 + 12 files changed, 133 insertions(+), 15 deletions(-) delete mode 100644 Projects/Feature/MainTabFeature/Sources/Sources.swift create mode 100644 Projects/Feature/RootFeature/Project.swift create mode 100644 Projects/Feature/RootFeature/Sources/RootCore.swift create mode 100644 Projects/Feature/RootFeature/Sources/RootView.swift create mode 100644 Projects/Feature/RootFeature/Tests/Tests.swift create mode 100644 Projects/UserInterface/DesignSystem/Resources/Colors/System.xcassets/Selected.colorset/Contents.json diff --git a/Projects/App/iOS/Sources/Application/OndoseeIOSApp.swift b/Projects/App/iOS/Sources/Application/OndoseeIOSApp.swift index 7bbedc5..c1d482f 100644 --- a/Projects/App/iOS/Sources/Application/OndoseeIOSApp.swift +++ b/Projects/App/iOS/Sources/Application/OndoseeIOSApp.swift @@ -1,10 +1,18 @@ import SwiftUI +import RootFeature @main struct OndoseeIOSApp: App { var body: some Scene { WindowGroup { - EmptyView() + RootView( + store: .init( + initialState: .init(), + reducer: { + RootCore() + } + ) + ) } } } diff --git a/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift b/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift index c7114f5..3c8ce04 100644 --- a/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift +++ b/Projects/Feature/MainTabFeature/Sources/MainTabCore.swift @@ -6,11 +6,11 @@ import WeeklyForecastFeature public struct MainTabCore: Reducer { public init() {} public struct State: Equatable { - var mainCore: MainCore.State - var weeklyCore: WeeklyForecastCore.State - var settingCore: SettingCore.State - - public init() { self = .init() } + var tabFlow: TabFlow = .main + var mainCore = MainCore.State() + var weeklyCore = WeeklyForecastCore.State() + var settingCore = SettingCore.State() + public init() {} } public enum Action { @@ -23,10 +23,13 @@ public struct MainTabCore: Reducer { public var body: some Reducer { Reduce { state, action in switch action { + case let .changeTabFlow(flow): + state.tabFlow = flow + return .none + default: return .none } - return .none } } } diff --git a/Projects/Feature/MainTabFeature/Sources/MainTabView.swift b/Projects/Feature/MainTabFeature/Sources/MainTabView.swift index ca341c8..ac358dd 100644 --- a/Projects/Feature/MainTabFeature/Sources/MainTabView.swift +++ b/Projects/Feature/MainTabFeature/Sources/MainTabView.swift @@ -10,11 +10,16 @@ public struct MainTabView: View { public init(store: StoreOf) { self.store = store + UITabBar.appearance().backgroundColor = .clear + UITabBar.appearance().scrollEdgeAppearance = .init() } public var body: some View { WithViewStore(self.store, observe: { $0 }) { viewStore in - TabView { + TabView(selection: viewStore.binding( + get: \.tabFlow, + send: MainTabCore.Action.changeTabFlow) + ) { MainView(store: store.scope( state: \.mainCore, action: MainTabCore.Action.mainCore) @@ -50,6 +55,7 @@ public struct MainTabView: View { .font(.medium(.system, size: .text3)) } } + .accentColor(.ondosee(.system(.selected))) } } } diff --git a/Projects/Feature/MainTabFeature/Sources/Sources.swift b/Projects/Feature/MainTabFeature/Sources/Sources.swift deleted file mode 100644 index 50ff8a0..0000000 --- a/Projects/Feature/MainTabFeature/Sources/Sources.swift +++ /dev/null @@ -1,2 +0,0 @@ -import SwiftUI - diff --git a/Projects/Feature/RootFeature/Project.swift b/Projects/Feature/RootFeature/Project.swift new file mode 100644 index 0000000..de1cb42 --- /dev/null +++ b/Projects/Feature/RootFeature/Project.swift @@ -0,0 +1,16 @@ +import DependencyPlugin +import ProjectDescription +import ProjectDescriptionHelpers + +let project = Project.module( + name: ModulePaths.Feature.RootFeature.rawValue, + targets: [ + .implements(module: .feature(.RootFeature), dependencies: [ + .feature(target: .BaseFeature), + .feature(target: .MainTabFeature) + ]), + .tests(module: .feature(.RootFeature), dependencies: [ + .feature(target: .RootFeature) + ]) + ] +) diff --git a/Projects/Feature/RootFeature/Sources/RootCore.swift b/Projects/Feature/RootFeature/Sources/RootCore.swift new file mode 100644 index 0000000..59fe1ed --- /dev/null +++ b/Projects/Feature/RootFeature/Sources/RootCore.swift @@ -0,0 +1,26 @@ +import ComposableArchitecture +import Foundation +import MainTabFeature + +public struct RootCore: Reducer { + public init() {} + public enum State: Equatable { + case mainTab(MainTabCore.State) + + public init() { self = .mainTab(.init()) } + } + + public enum Action { + case mainTabCore(MainTabCore.Action) + } + + public var body: some Reducer { + Reduce { state, action in + switch action { + case .mainTabCore: + state = .mainTab(.init()) + return .none + } + } + } +} diff --git a/Projects/Feature/RootFeature/Sources/RootView.swift b/Projects/Feature/RootFeature/Sources/RootView.swift new file mode 100644 index 0000000..68fd5c7 --- /dev/null +++ b/Projects/Feature/RootFeature/Sources/RootView.swift @@ -0,0 +1,22 @@ +import ComposableArchitecture +import SwiftUI +import MainTabFeature + +public struct RootView: View { + private let store: StoreOf + + public init(store: StoreOf) { + self.store = store + } + + public var body: some View { + SwitchStore(store) { + switch $0 { + case .mainTab: + CaseLet(/RootCore.State.mainTab, action: RootCore.Action.mainTabCore) { store in + MainTabView(store: store) + } + } + } + } +} diff --git a/Projects/Feature/RootFeature/Tests/Tests.swift b/Projects/Feature/RootFeature/Tests/Tests.swift new file mode 100644 index 0000000..9f44cbf --- /dev/null +++ b/Projects/Feature/RootFeature/Tests/Tests.swift @@ -0,0 +1 @@ +// This is For Tuist diff --git a/Projects/Feature/SettingFeature/Sources/SettingCore.swift b/Projects/Feature/SettingFeature/Sources/SettingCore.swift index b348de8..5ea1f3b 100644 --- a/Projects/Feature/SettingFeature/Sources/SettingCore.swift +++ b/Projects/Feature/SettingFeature/Sources/SettingCore.swift @@ -4,7 +4,7 @@ import Foundation public struct SettingCore: Reducer { public init() {} public struct State: Equatable { - + public init() {} } public enum Action: Equatable { diff --git a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift index 038f697..977d559 100644 --- a/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift +++ b/Projects/Feature/WeeklyForecastFeature/Sources/WeeklyForecastCore.swift @@ -4,14 +4,12 @@ import Foundation public struct WeeklyForecastCore: Reducer { public init() {} public struct State: Equatable { - + public init() {} } public enum Action: Equatable { - } - public func reduce(into state: inout State, action: Action) -> Effect { - + public func reduce(into state: inout State, action: Action) -> Effect { } } diff --git a/Projects/UserInterface/DesignSystem/Resources/Colors/System.xcassets/Selected.colorset/Contents.json b/Projects/UserInterface/DesignSystem/Resources/Colors/System.xcassets/Selected.colorset/Contents.json new file mode 100644 index 0000000..0c600f9 --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Resources/Colors/System.xcassets/Selected.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0x00" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/UserInterface/DesignSystem/Sources/Color/ODColorSystem+System.swift b/Projects/UserInterface/DesignSystem/Sources/Color/ODColorSystem+System.swift index cd9c6b1..80417e2 100644 --- a/Projects/UserInterface/DesignSystem/Sources/Color/ODColorSystem+System.swift +++ b/Projects/UserInterface/DesignSystem/Sources/Color/ODColorSystem+System.swift @@ -7,6 +7,7 @@ public extension Color.OndoseeColorSystem { case secondary case tertiary case warning + case selected } } @@ -18,6 +19,7 @@ public extension Color.OndoseeColorSystem.System { case .secondary: return DesignSystemAsset.System.secondary.swiftUIColor case .tertiary: return DesignSystemAsset.System.tertiary.swiftUIColor case .warning: return DesignSystemAsset.System.warning.swiftUIColor + case .selected: return DesignSystemAsset.System.selected.swiftUIColor } } } From d0df29a2dcfabb13690c1b5fe3396d7ea52f7f66 Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Wed, 11 Sep 2024 11:50:40 +0900 Subject: [PATCH 15/16] :lipstick: :: add ODIcon --- .gitignore | 3 -- .../DesignSystem/Sources/Icon/ODIcon.swift | 41 +++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 Projects/UserInterface/DesignSystem/Sources/Icon/ODIcon.swift diff --git a/.gitignore b/.gitignore index 665ec07..f155983 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,6 @@ .AppleDouble .LSOverride -# Icon must end with two -Icon - # Thumbnails ._* diff --git a/Projects/UserInterface/DesignSystem/Sources/Icon/ODIcon.swift b/Projects/UserInterface/DesignSystem/Sources/Icon/ODIcon.swift new file mode 100644 index 0000000..79af3a4 --- /dev/null +++ b/Projects/UserInterface/DesignSystem/Sources/Icon/ODIcon.swift @@ -0,0 +1,41 @@ +import SwiftUI + +public struct ODIcon: View { + var icon: Icon + var renderingMode: Image.TemplateRenderingMode + var width: CGFloat? + var height: CGFloat? + + public init( + _ icon: Icon, + renderingMode: Image.TemplateRenderingMode = .template, + width: CGFloat? = 24, + height: CGFloat? = 24 + ) { + self.icon = icon + self.renderingMode = renderingMode + self.width = width + self.height = height + } + + public enum Icon: CaseIterable { + case home + case setting + case calendar + } + + public var body: some View { + iconToImage() + .resizable() + .renderingMode(renderingMode) + .frame(width: width, height: height) + } + + private func iconToImage() -> Image { + switch icon { + case .home: return DesignSystemAsset.Icons.home.swiftUIImage + case .setting: return DesignSystemAsset.Icons.setting.swiftUIImage + case .calendar: return DesignSystemAsset.Icons.calendar.swiftUIImage + } + } +} From 23615ed25232bde8830961dc48176915da9dd162 Mon Sep 17 00:00:00 2001 From: uuuunseo Date: Wed, 11 Sep 2024 13:49:01 +0900 Subject: [PATCH 16/16] :sparkles: :: example Setting --- .../Example/Sources/AppDelegate.swift | 22 +++++++++++++++++- .../Example/Sources/AppDelegate.swift | 23 ++++++++++++++++++- .../Example/Sources/AppDelegate.swift | 22 +++++++++++++++++- 3 files changed, 64 insertions(+), 3 deletions(-) diff --git a/Projects/Feature/MainFeature/Example/Sources/AppDelegate.swift b/Projects/Feature/MainFeature/Example/Sources/AppDelegate.swift index 9f44cbf..9cc9166 100644 --- a/Projects/Feature/MainFeature/Example/Sources/AppDelegate.swift +++ b/Projects/Feature/MainFeature/Example/Sources/AppDelegate.swift @@ -1 +1,21 @@ -// This is For Tuist +import ComposableArchitecture +import SwiftUI +import MainFeature + +@main +struct WeeklyForecastApp: App { + var body: some Scene { + WindowGroup { + NavigationStack { + MainView( + store: Store( + initialState: MainCore.State(), + reducer: { + MainCore() + } + ) + ) + } + } + } +} diff --git a/Projects/Feature/SettingFeature/Example/Sources/AppDelegate.swift b/Projects/Feature/SettingFeature/Example/Sources/AppDelegate.swift index 9f44cbf..3658b68 100644 --- a/Projects/Feature/SettingFeature/Example/Sources/AppDelegate.swift +++ b/Projects/Feature/SettingFeature/Example/Sources/AppDelegate.swift @@ -1 +1,22 @@ -// This is For Tuist +import ComposableArchitecture +import SwiftUI +import SettingFeature + +@main +struct WeeklyForecastApp: App { + var body: some Scene { + WindowGroup { + NavigationStack { + SettingView( + store: Store( + initialState: SettingCore.State(), + reducer: { + SettingCore() + } + ) + ) + } + } + } +} + diff --git a/Projects/Feature/WeeklyForecastFeature/Example/Sources/AppDelegate.swift b/Projects/Feature/WeeklyForecastFeature/Example/Sources/AppDelegate.swift index 9f44cbf..884acf8 100644 --- a/Projects/Feature/WeeklyForecastFeature/Example/Sources/AppDelegate.swift +++ b/Projects/Feature/WeeklyForecastFeature/Example/Sources/AppDelegate.swift @@ -1 +1,21 @@ -// This is For Tuist +import ComposableArchitecture +import SwiftUI +import WeeklyForecastFeature + +@main +struct WeeklyForecastApp: App { + var body: some Scene { + WindowGroup { + NavigationStack { + WeeklyForecastView( + store: Store( + initialState: WeeklyForecastCore.State(), + reducer: { + WeeklyForecastCore() + } + ) + ) + } + } + } +}