-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b35b26
commit fb1b77b
Showing
112 changed files
with
2,404 additions
and
797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import RxFlow | ||
|
||
public enum OauthLoginStep: Step { | ||
case oauthLoginIsRequired | ||
case emailLoginisRequired | ||
case emailSignupIsRequired | ||
case tabIsRequired | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import RxFlow | ||
|
||
public enum OnboardingStep: Step { | ||
case oauthLoginIsRequired | ||
case tabIsRequired | ||
case onboardingIsRequired | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import RxFlow | ||
|
||
public enum AgeSignupStep: Step { | ||
case ageSignupIsRequired | ||
case oauthLoginIsRequired | ||
case proFilSignupIsRequired | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import RxFlow | ||
|
||
public enum EmailSignupStep: Step { | ||
case emailSignupIsRequired | ||
case oauthLoginIsRequired | ||
case passwordSignupIsrequired | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import RxFlow | ||
|
||
public enum NickNameSignupStep: Step { | ||
case ageSignupIsRequired | ||
case oauthLoginIsRequired | ||
case nickNameSignupIsRequired | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import RxFlow | ||
|
||
public enum PasswordSignupStep: Step { | ||
case oauthLoginIsRequired | ||
case passwordSignupIsrequired | ||
case nickNameSignupIsRequired | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import RxFlow | ||
|
||
public enum ProFilSignupStep: Step { | ||
case oauthLoginIsRequired | ||
case proFilSignupIsRequired | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import UIKit | ||
import RxFlow | ||
import RxSwift | ||
import Core | ||
import Swinject | ||
import Presentation | ||
|
||
public final class AgeSignupFlow: Flow { | ||
public let container: Container | ||
public var root: Presentable { | ||
return self.rootViewController | ||
} | ||
|
||
private let rootViewController: AgeSignupViewController | ||
|
||
public init(container: Container) { | ||
self.container = container | ||
self.rootViewController = container.resolve(AgeSignupViewController.self)! | ||
} | ||
|
||
public func navigate(to step: Step) -> FlowContributors { | ||
guard let step = step as? AgeSignupStep else { return .none } | ||
|
||
switch step { | ||
case .ageSignupIsRequired: | ||
return navigationToAgeSignup() | ||
case .proFilSignupIsRequired: | ||
return navigationToProFilSignup() | ||
case .oauthLoginIsRequired: | ||
return .end(forwardToParentFlowWithStep: NickNameSignupStep.oauthLoginIsRequired) | ||
} | ||
} | ||
} | ||
|
||
private extension AgeSignupFlow { | ||
func navigationToAgeSignup() -> FlowContributors { | ||
return .one(flowContributor: .contribute( | ||
withNextPresentable: rootViewController, | ||
withNextStepper: rootViewController.reactor | ||
)) | ||
} | ||
|
||
func navigationToProFilSignup() -> FlowContributors { | ||
let profilSignupFlow = ProFilSignupFlow(container: container) | ||
|
||
Flows.use(profilSignupFlow, when: .created) { (root) in | ||
self.rootViewController.navigationController?.pushViewController( | ||
root, | ||
animated: true | ||
) | ||
} | ||
|
||
return .one(flowContributor: .contribute( | ||
withNextPresentable: rootViewController, | ||
withNextStepper: rootViewController.reactor | ||
)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import UIKit | ||
import RxFlow | ||
import RxSwift | ||
import Core | ||
import Swinject | ||
import Presentation | ||
|
||
public final class EmailSignupFlow: Flow { | ||
public let container: Container | ||
public var root: Presentable { | ||
return self.rootViewController | ||
} | ||
|
||
private let rootViewController: EmailSignupViewController | ||
|
||
public init(container: Container) { | ||
self.container = container | ||
self.rootViewController = container.resolve(EmailSignupViewController.self)! | ||
} | ||
|
||
public func navigate(to step: Step) -> FlowContributors { | ||
guard let step = step as? EmailSignupStep else { return .none } | ||
|
||
switch step { | ||
case .emailSignupIsRequired: | ||
return navigationToEmailSignup() | ||
case .passwordSignupIsrequired: | ||
return navigationToPasswordSignup() | ||
case .oauthLoginIsRequired: | ||
return .end(forwardToParentFlowWithStep: OauthLoginStep.oauthLoginIsRequired) | ||
} | ||
} | ||
} | ||
|
||
private extension EmailSignupFlow { | ||
func navigationToEmailSignup() -> FlowContributors { | ||
return .one(flowContributor: .contribute( | ||
withNextPresentable: rootViewController, | ||
withNextStepper: rootViewController.reactor | ||
)) | ||
} | ||
|
||
func navigationToPasswordSignup() -> FlowContributors { | ||
let passwordSignupFlow = PasswordSignupFlow(container: container) | ||
|
||
Flows.use(passwordSignupFlow, when: .created) { (root) in | ||
self.rootViewController.navigationController?.pushViewController( | ||
root, | ||
animated: true | ||
) | ||
} | ||
|
||
return .one(flowContributor: .contribute( | ||
withNextPresentable: passwordSignupFlow, | ||
withNextStepper: OneStepper(withSingleStep: PasswordSignupStep.passwordSignupIsrequired) | ||
)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import UIKit | ||
import RxFlow | ||
import RxSwift | ||
import Core | ||
import Swinject | ||
import Presentation | ||
|
||
public final class NickNameSignupFlow: Flow { | ||
public let container: Container | ||
public var root: Presentable { | ||
return self.rootViewController | ||
} | ||
|
||
private let rootViewController: NickNameSignupViewController | ||
|
||
public init(container: Container) { | ||
self.container = container | ||
self.rootViewController = container.resolve(NickNameSignupViewController.self)! | ||
} | ||
|
||
public func navigate(to step: Step) -> FlowContributors { | ||
guard let step = step as? NickNameSignupStep else { return .none } | ||
|
||
switch step { | ||
case .ageSignupIsRequired: | ||
return navigationToAgeSignup() | ||
case .oauthLoginIsRequired: | ||
return .end(forwardToParentFlowWithStep: PasswordSignupStep.oauthLoginIsRequired) | ||
case .nickNameSignupIsRequired: | ||
return navigationToNickNameSignup() | ||
} | ||
} | ||
} | ||
|
||
private extension NickNameSignupFlow { | ||
func navigationToNickNameSignup() -> FlowContributors { | ||
return .one(flowContributor: .contribute( | ||
withNextPresentable: rootViewController, | ||
withNextStepper: rootViewController.reactor | ||
)) | ||
} | ||
|
||
func navigationToAgeSignup() -> FlowContributors { | ||
let ageSignupFlow = AgeSignupFlow(container: container) | ||
|
||
Flows.use(ageSignupFlow, when: .created) { (root) in | ||
self.rootViewController.navigationController?.pushViewController( | ||
root, | ||
animated: true | ||
) | ||
} | ||
|
||
return .one(flowContributor: .contribute( | ||
withNextPresentable: ageSignupFlow, | ||
withNextStepper: OneStepper(withSingleStep: AgeSignupStep.ageSignupIsRequired) | ||
)) | ||
} | ||
} |
Oops, something went wrong.