Skip to content

Commit

Permalink
πŸ”€ :: (#12) νšŒμ›κ°€μž… Flow
Browse files Browse the repository at this point in the history
  • Loading branch information
HongSJae authored Apr 26, 2024
2 parents f9ba81d + 0e6e772 commit 583857c
Show file tree
Hide file tree
Showing 47 changed files with 471 additions and 186 deletions.
6 changes: 5 additions & 1 deletion Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import Foundation
import ProjectDescription
import ProjectDescriptionHelpers

let configurations: [Configuration] = .default
let configurations: [Configuration] = [
.debug(name: .dev, xcconfig: .relativeToXCConfig(type: .dev, name: env.name)),
.debug(name: .stage, xcconfig: .relativeToXCConfig(type: .stage, name: env.name)),
.release(name: .prod, xcconfig: .relativeToXCConfig(type: .prod, name: env.name))
]

let settings: Settings = .settings(
base: env.baseSetting,
Expand Down
11 changes: 7 additions & 4 deletions Projects/App/Sources/Application/DI/AppComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@ public extension AppComponent {
SigninComponent(parent: self)
}
// Signup
var signupEmailVerifyFactory: any SignupEmailVerifyFactory {
SignupEmailVerifyComponent(parent: self)
var signupEmailFactory: any SignupEmailFactory {
SignupEmailComponent(parent: self)
}
var signupEmailAuthCodeVerifyFactory: any SignupEmailAuthCodeVerifyFactory {
SignupEmailAuthCodeVerifyComponent(parent: self)
var signupVerifyAuthCode: any SignupVerifyAuthCodeFactory {
SignupVerifyAuthCodeComponent(parent: self)
}
var signupPasswordFactory: any SignupPasswordFactory {
SignupPasswordComponent(parent: self)
}
var signupUserInfoFlowFactory: any SignupUserInfoFlowFactory {
SignupUserInfoFlowComponent(parent: self)
}
var signupNameFactory: any SignupNameFactory {
SignupNameComponent(parent: self)
}
Expand Down
120 changes: 74 additions & 46 deletions Projects/App/Sources/Application/NeedleGenerated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ private class SplashDependencye0cb7136f2ec3edfd60aProvider: SplashDependency {
private func factoryace9f05f51d68f4c0677e3b0c44298fc1c149afb(_ component: NeedleFoundation.Scope) -> AnyObject {
return SplashDependencye0cb7136f2ec3edfd60aProvider()
}
private class SignupPasswordDependency778bf5389a70d7df6152Provider: SignupPasswordDependency {
var signupNameFactory: any SignupNameFactory {
return appComponent.signupNameFactory
private class SignupVerifyAuthCodeDependencyc5bfc91282e270b5f35aProvider: SignupVerifyAuthCodeDependency {
var signupPasswordFactory: any SignupPasswordFactory {
return appComponent.signupPasswordFactory
}
private let appComponent: AppComponent
init(appComponent: AppComponent) {
self.appComponent = appComponent
}
}
/// ^->AppComponent->SignupPasswordComponent
private func factorye93d1d56840ff97c674af47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return SignupPasswordDependency778bf5389a70d7df6152Provider(appComponent: parent1(component) as! AppComponent)
/// ^->AppComponent->SignupVerifyAuthCodeComponent
private func factoryff5803dec4bd48820d95f47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return SignupVerifyAuthCodeDependencyc5bfc91282e270b5f35aProvider(appComponent: parent1(component) as! AppComponent)
}
private class SignupEmailAuthCodeVerifyDependencyaf9da1ebf0e9e5f1b708Provider: SignupEmailAuthCodeVerifyDependency {
var signupPasswordFactory: any SignupPasswordFactory {
return appComponent.signupPasswordFactory
private class SignupPasswordDependency778bf5389a70d7df6152Provider: SignupPasswordDependency {
var signupUserInfoFlowFactory: any SignupUserInfoFlowFactory {
return appComponent.signupUserInfoFlowFactory
}
private let appComponent: AppComponent
init(appComponent: AppComponent) {
self.appComponent = appComponent
}
}
/// ^->AppComponent->SignupEmailAuthCodeVerifyComponent
private func factoryb06be35aa893adde971bf47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return SignupEmailAuthCodeVerifyDependencyaf9da1ebf0e9e5f1b708Provider(appComponent: parent1(component) as! AppComponent)
/// ^->AppComponent->SignupPasswordComponent
private func factorye93d1d56840ff97c674af47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return SignupPasswordDependency778bf5389a70d7df6152Provider(appComponent: parent1(component) as! AppComponent)
}
private class SignupStudentIDDependencyc62f548e51245f5bf42dProvider: SignupStudentIDDependency {
var signupGenderFactory: any SignupGenderFactory {
Expand All @@ -75,17 +75,15 @@ private func factorycca12bec445b4f4f6de7f47b58f8f304c97af4d5(_ component: Needle
return SignupStudentIDDependencyc62f548e51245f5bf42dProvider(appComponent: parent1(component) as! AppComponent)
}
private class SignupGenderDependency65e2a6565372eb41f4acProvider: SignupGenderDependency {
var signupCheckLevelFactory: any SignupCheckLevelFactory {
return appComponent.signupCheckLevelFactory
}
private let appComponent: AppComponent
init(appComponent: AppComponent) {
self.appComponent = appComponent


init() {

}
}
/// ^->AppComponent->SignupGenderComponent
private func factory997eaa831d16af15eee5f47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return SignupGenderDependency65e2a6565372eb41f4acProvider(appComponent: parent1(component) as! AppComponent)
private func factory997eaa831d16af15eee5e3b0c44298fc1c149afb(_ component: NeedleFoundation.Scope) -> AnyObject {
return SignupGenderDependency65e2a6565372eb41f4acProvider()
}
private class SignupCheckLevelDependencye4ec84c7d38354a454aeProvider: SignupCheckLevelDependency {

Expand All @@ -99,30 +97,50 @@ private func factory5b23127e837152346fdae3b0c44298fc1c149afb(_ component: Needle
return SignupCheckLevelDependencye4ec84c7d38354a454aeProvider()
}
private class SignupNameDependency860534ba64c054146b7bProvider: SignupNameDependency {


init() {

}
}
/// ^->AppComponent->SignupNameComponent
private func factory71e8fa7f4327b1e25ed0e3b0c44298fc1c149afb(_ component: NeedleFoundation.Scope) -> AnyObject {
return SignupNameDependency860534ba64c054146b7bProvider()
}
private class SignupUserInfoFlowDependencyc2b570f167242d15d8e8Provider: SignupUserInfoFlowDependency {
var signupNameFactory: any SignupNameFactory {
return appComponent.signupNameFactory
}
var signupStudentIDFactory: any SignupStudentIDFactory {
return appComponent.signupStudentIDFactory
}
var signupGenderFactory: any SignupGenderFactory {
return appComponent.signupGenderFactory
}
var signupCheckLevelFactory: any SignupCheckLevelFactory {
return appComponent.signupCheckLevelFactory
}
private let appComponent: AppComponent
init(appComponent: AppComponent) {
self.appComponent = appComponent
}
}
/// ^->AppComponent->SignupNameComponent
private func factory71e8fa7f4327b1e25ed0f47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return SignupNameDependency860534ba64c054146b7bProvider(appComponent: parent1(component) as! AppComponent)
/// ^->AppComponent->SignupUserInfoFlowComponent
private func factoryce6f8b9af5f65c8e334ef47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return SignupUserInfoFlowDependencyc2b570f167242d15d8e8Provider(appComponent: parent1(component) as! AppComponent)
}
private class SignupEmailVerifyDependencyf9d372ac752ee19b78caProvider: SignupEmailVerifyDependency {
var signupEmailAuthCodeVerifyFactory: any SignupEmailAuthCodeVerifyFactory {
return appComponent.signupEmailAuthCodeVerifyFactory
private class SignupEmailDependency844c9e928af75b6aaa7aProvider: SignupEmailDependency {
var signupVerifyAuthCode: any SignupVerifyAuthCodeFactory {
return appComponent.signupVerifyAuthCode
}
private let appComponent: AppComponent
init(appComponent: AppComponent) {
self.appComponent = appComponent
}
}
/// ^->AppComponent->SignupEmailVerifyComponent
private func factory3b1904c76335d70151ebf47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return SignupEmailVerifyDependencyf9d372ac752ee19b78caProvider(appComponent: parent1(component) as! AppComponent)
/// ^->AppComponent->SignupEmailComponent
private func factory4d1ddf658c5970ef6b47f47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return SignupEmailDependency844c9e928af75b6aaa7aProvider(appComponent: parent1(component) as! AppComponent)
}
private class RootDependency3944cc797a4a88956fb5Provider: RootDependency {
var splashFactory: any SplashFactory {
Expand All @@ -141,8 +159,8 @@ private func factory264bfc4d4cb6b0629b40f47b58f8f304c97af4d5(_ component: Needle
return RootDependency3944cc797a4a88956fb5Provider(appComponent: parent1(component) as! AppComponent)
}
private class SigninDependencyde06a9d0b22764487733Provider: SigninDependency {
var signupEmailVerifyFactory: any SignupEmailVerifyFactory {
return appComponent.signupEmailVerifyFactory
var signupEmailFactory: any SignupEmailFactory {
return appComponent.signupEmailFactory
}
private let appComponent: AppComponent
init(appComponent: AppComponent) {
Expand All @@ -160,9 +178,10 @@ extension AppComponent: Registration {

localTable["splashFactory-any SplashFactory"] = { [unowned self] in self.splashFactory as Any }
localTable["signinFactory-any SigninFactory"] = { [unowned self] in self.signinFactory as Any }
localTable["signupEmailVerifyFactory-any SignupEmailVerifyFactory"] = { [unowned self] in self.signupEmailVerifyFactory as Any }
localTable["signupEmailAuthCodeVerifyFactory-any SignupEmailAuthCodeVerifyFactory"] = { [unowned self] in self.signupEmailAuthCodeVerifyFactory as Any }
localTable["signupEmailFactory-any SignupEmailFactory"] = { [unowned self] in self.signupEmailFactory as Any }
localTable["signupVerifyAuthCode-any SignupVerifyAuthCodeFactory"] = { [unowned self] in self.signupVerifyAuthCode as Any }
localTable["signupPasswordFactory-any SignupPasswordFactory"] = { [unowned self] in self.signupPasswordFactory as Any }
localTable["signupUserInfoFlowFactory-any SignupUserInfoFlowFactory"] = { [unowned self] in self.signupUserInfoFlowFactory as Any }
localTable["signupNameFactory-any SignupNameFactory"] = { [unowned self] in self.signupNameFactory as Any }
localTable["signupStudentIDFactory-any SignupStudentIDFactory"] = { [unowned self] in self.signupStudentIDFactory as Any }
localTable["signupGenderFactory-any SignupGenderFactory"] = { [unowned self] in self.signupGenderFactory as Any }
Expand All @@ -174,14 +193,14 @@ extension SplashComponent: Registration {

}
}
extension SignupPasswordComponent: Registration {
extension SignupVerifyAuthCodeComponent: Registration {
public func registerItems() {
keyPathToName[\SignupPasswordDependency.signupNameFactory] = "signupNameFactory-any SignupNameFactory"
keyPathToName[\SignupVerifyAuthCodeDependency.signupPasswordFactory] = "signupPasswordFactory-any SignupPasswordFactory"
}
}
extension SignupEmailAuthCodeVerifyComponent: Registration {
extension SignupPasswordComponent: Registration {
public func registerItems() {
keyPathToName[\SignupEmailAuthCodeVerifyDependency.signupPasswordFactory] = "signupPasswordFactory-any SignupPasswordFactory"
keyPathToName[\SignupPasswordDependency.signupUserInfoFlowFactory] = "signupUserInfoFlowFactory-any SignupUserInfoFlowFactory"
}
}
extension SignupStudentIDComponent: Registration {
Expand All @@ -191,7 +210,7 @@ extension SignupStudentIDComponent: Registration {
}
extension SignupGenderComponent: Registration {
public func registerItems() {
keyPathToName[\SignupGenderDependency.signupCheckLevelFactory] = "signupCheckLevelFactory-any SignupCheckLevelFactory"

}
}
extension SignupCheckLevelComponent: Registration {
Expand All @@ -201,12 +220,20 @@ extension SignupCheckLevelComponent: Registration {
}
extension SignupNameComponent: Registration {
public func registerItems() {
keyPathToName[\SignupNameDependency.signupStudentIDFactory] = "signupStudentIDFactory-any SignupStudentIDFactory"

}
}
extension SignupUserInfoFlowComponent: Registration {
public func registerItems() {
keyPathToName[\SignupUserInfoFlowDependency.signupNameFactory] = "signupNameFactory-any SignupNameFactory"
keyPathToName[\SignupUserInfoFlowDependency.signupStudentIDFactory] = "signupStudentIDFactory-any SignupStudentIDFactory"
keyPathToName[\SignupUserInfoFlowDependency.signupGenderFactory] = "signupGenderFactory-any SignupGenderFactory"
keyPathToName[\SignupUserInfoFlowDependency.signupCheckLevelFactory] = "signupCheckLevelFactory-any SignupCheckLevelFactory"
}
}
extension SignupEmailVerifyComponent: Registration {
extension SignupEmailComponent: Registration {
public func registerItems() {
keyPathToName[\SignupEmailVerifyDependency.signupEmailAuthCodeVerifyFactory] = "signupEmailAuthCodeVerifyFactory-any SignupEmailAuthCodeVerifyFactory"
keyPathToName[\SignupEmailDependency.signupVerifyAuthCode] = "signupVerifyAuthCode-any SignupVerifyAuthCodeFactory"
}
}
extension RootComponent: Registration {
Expand All @@ -217,7 +244,7 @@ extension RootComponent: Registration {
}
extension SigninComponent: Registration {
public func registerItems() {
keyPathToName[\SigninDependency.signupEmailVerifyFactory] = "signupEmailVerifyFactory-any SignupEmailVerifyFactory"
keyPathToName[\SigninDependency.signupEmailFactory] = "signupEmailFactory-any SignupEmailFactory"
}
}

Expand All @@ -238,13 +265,14 @@ private func registerProviderFactory(_ componentPath: String, _ factory: @escapi
@inline(never) private func register1() {
registerProviderFactory("^->AppComponent", factoryEmptyDependencyProvider)
registerProviderFactory("^->AppComponent->SplashComponent", factoryace9f05f51d68f4c0677e3b0c44298fc1c149afb)
registerProviderFactory("^->AppComponent->SignupVerifyAuthCodeComponent", factoryff5803dec4bd48820d95f47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->SignupPasswordComponent", factorye93d1d56840ff97c674af47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->SignupEmailAuthCodeVerifyComponent", factoryb06be35aa893adde971bf47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->SignupStudentIDComponent", factorycca12bec445b4f4f6de7f47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->SignupGenderComponent", factory997eaa831d16af15eee5f47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->SignupGenderComponent", factory997eaa831d16af15eee5e3b0c44298fc1c149afb)
registerProviderFactory("^->AppComponent->SignupCheckLevelComponent", factory5b23127e837152346fdae3b0c44298fc1c149afb)
registerProviderFactory("^->AppComponent->SignupNameComponent", factory71e8fa7f4327b1e25ed0f47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->SignupEmailVerifyComponent", factory3b1904c76335d70151ebf47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->SignupNameComponent", factory71e8fa7f4327b1e25ed0e3b0c44298fc1c149afb)
registerProviderFactory("^->AppComponent->SignupUserInfoFlowComponent", factoryce6f8b9af5f65c8e334ef47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->SignupEmailComponent", factory4d1ddf658c5970ef6b47f47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->RootComponent", factory264bfc4d4cb6b0629b40f47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->SigninComponent", factory2882a056d84a613debccf47b58f8f304c97af4d5)
}
Expand Down
4 changes: 2 additions & 2 deletions Projects/App/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>CFBundleDisplayName</key>
<string>$(BUNDLE_DISPLAY_NAME)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
Expand Down
4 changes: 2 additions & 2 deletions Projects/Feature/SigninFeature/Sources/SigninComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import SigninFeatureInterface
import SignupFeatureInterface

public protocol SigninDependency: Dependency {
var signupEmailVerifyFactory: any SignupEmailVerifyFactory { get }
var signupEmailFactory: any SignupEmailFactory { get }
}

public final class SigninComponent: Component<SigninDependency>, SigninFactory {
public func makeView() -> some View {
SigninView(
viewModel: .init(),
signupEmailVerifyFactory: dependency.signupEmailVerifyFactory
signupEmailFactory: dependency.signupEmailFactory
)
}
}
8 changes: 4 additions & 4 deletions Projects/Feature/SigninFeature/Sources/SigninView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ struct SigninView: View {
@FocusState private var focusField: FocusField?
@StateObject var viewModel: SigninViewModel

private let signupEmailVerifyFactory: any SignupEmailVerifyFactory
private let signupEmailFactory: any SignupEmailFactory

init(
viewModel: SigninViewModel,
signupEmailVerifyFactory: any SignupEmailVerifyFactory
signupEmailFactory: any SignupEmailFactory
) {
_viewModel = StateObject(wrappedValue: viewModel)
self.signupEmailVerifyFactory = signupEmailVerifyFactory
self.signupEmailFactory = signupEmailFactory
}

var body: some View {
Expand Down Expand Up @@ -70,6 +70,6 @@ struct SigninView: View {

Spacer()
}
.navigate(to: signupEmailVerifyFactory.makeView().eraseToAnyView(), when: $viewModel.isNavigatedToSignup)
.navigate(to: signupEmailFactory.makeView().eraseToAnyView(), when: $viewModel.isNavigatedToSignup)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SwiftUI

public protocol SignupEmailAuthCodeVerifyFactory {
public protocol SignupVerifyAuthCodeFactory {
associatedtype SomeView: View
func makeView() -> SomeView
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SwiftUI

public protocol SignupEmailVerifyFactory {
public protocol SignupEmailFactory {
associatedtype SomeView: View
func makeView() -> SomeView
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import SwiftUI

public protocol SignupCheckLevelFactory {
associatedtype SomeView: View
func makeView() -> SomeView
func makeView(nextViewNavigateAction: @escaping () -> Void) -> SomeView
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import SwiftUI

public protocol SignupGenderFactory {
associatedtype SomeView: View
func makeView() -> SomeView
func makeView(nextViewNavigateAction: @escaping () -> Void) -> SomeView
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import SwiftUI

public protocol SignupNameFactory {
associatedtype SomeView: View
func makeView() -> SomeView
func makeView(nextViewNavigateAction: @escaping () -> Void) -> SomeView
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import SwiftUI

public protocol SignupStudentIDFactory {
associatedtype SomeView: View
func makeView() -> SomeView
func makeView(nextViewNavigateAction: @escaping () -> Void) -> SomeView
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import SwiftUI

public protocol SignupUserInfoFlowFactory {
associatedtype SomeView: View
func makeView() -> SomeView
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import SwiftUI
import NeedleFoundation
import SignupFeatureInterface

public protocol SignupEmailDependency: Dependency {
var signupVerifyAuthCode: any SignupVerifyAuthCodeFactory { get }
}

public final class SignupEmailComponent: Component<SignupEmailDependency>, SignupEmailFactory {
public func makeView() -> some View {
SignupEmailView(
viewModel: .init(),
signupVerifyAuthCode: dependency.signupVerifyAuthCode
)
}
}
Loading

0 comments on commit 583857c

Please sign in to comment.