-
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
f6332f2
commit 8abd36b
Showing
7 changed files
with
63 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import RxFlow | ||
|
||
public enum EmailLoginStep: Step { | ||
case emailLoginisRequired | ||
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
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,40 @@ | ||
import UIKit | ||
import RxFlow | ||
import RxSwift | ||
import Core | ||
import Swinject | ||
import Presentation | ||
|
||
public final class EmailLoginFlow: Flow { | ||
public let container: Container | ||
public var root: Presentable { | ||
return self.rootViewController | ||
} | ||
|
||
public let rootViewController: EmailLoginViewController | ||
|
||
public init(container: Container) { | ||
self.container = container | ||
self.rootViewController = container.resolve(EmailLoginViewController.self)! | ||
} | ||
|
||
public func navigate(to step: Step) -> FlowContributors { | ||
guard let step = step as? EmailLoginStep else { return .none } | ||
|
||
switch step { | ||
case .emailLoginisRequired: | ||
return navigationToEmailLogin() | ||
case .tabIsRequired: | ||
return .end(forwardToParentFlowWithStep: OauthLoginStep.tabIsRequired) | ||
} | ||
} | ||
} | ||
|
||
private extension EmailLoginFlow { | ||
func navigationToEmailLogin() -> FlowContributors { | ||
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
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