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 } } }