-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
๐ :: (#178) ๋ฉด์ ํ๊ธฐ ์์ฑ & ์กฐํ ๊ฐ๋ฐ
- Loading branch information
Showing
36 changed files
with
1,422 additions
and
42 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 AddReviewStep: Step { | ||
case addReviewIsRequired | ||
case dismissToWritableReview | ||
} |
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,5 @@ | ||
import RxFlow | ||
|
||
public enum InterviewReviewDetailStep: Step { | ||
case interviewReviewDetailIsRequired | ||
} |
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,7 @@ | ||
import RxFlow | ||
|
||
public enum WritableReviewStep: Step { | ||
case writableReviewIsRequired | ||
case addReviewIsRequired | ||
case popToMyPage | ||
} |
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
6 changes: 3 additions & 3 deletions
6
...mpanies/WritableReviewCompanyEntity.swift โ ...Reviews/WritableReviewCompanyEntity.swift
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import Foundation | ||
|
||
public struct WritableReviewCompanyEntity: Equatable, Hashable { | ||
public let reviewID: Int | ||
public let companyID: Int | ||
public let name: String | ||
|
||
public init(reviewID: Int, name: String) { | ||
self.reviewID = reviewID | ||
public init(companyID: Int, name: String) { | ||
self.companyID = companyID | ||
self.name = name | ||
} | ||
} |
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,36 @@ | ||
import UIKit | ||
import Presentation | ||
import Swinject | ||
import RxFlow | ||
import Core | ||
|
||
public final class InterviewReviewDetailFlow: Flow { | ||
public let container: Container | ||
private let rootViewController: InterviewReviewDetailViewController | ||
public var root: Presentable { | ||
return rootViewController | ||
} | ||
|
||
public init(container: Container) { | ||
self.container = container | ||
self.rootViewController = container.resolve(InterviewReviewDetailViewController.self)! | ||
} | ||
|
||
public func navigate(to step: Step) -> FlowContributors { | ||
guard let step = step as? InterviewReviewDetailStep else { return .none } | ||
|
||
switch step { | ||
case .interviewReviewDetailIsRequired: | ||
return navigateToInterviewReviewDetail() | ||
} | ||
} | ||
} | ||
|
||
private extension InterviewReviewDetailFlow { | ||
func navigateToInterviewReviewDetail() -> FlowContributors { | ||
return .one(flowContributor: .contribute( | ||
withNextPresentable: rootViewController, | ||
withNextStepper: rootViewController.viewModel | ||
)) | ||
} | ||
} |
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,48 @@ | ||
import UIKit | ||
import Presentation | ||
import Swinject | ||
import RxFlow | ||
import Core | ||
|
||
public final class AddReviewFlow: Flow { | ||
public let container: Container | ||
private let rootViewController: AddReviewViewController | ||
public var root: Presentable { | ||
return rootViewController | ||
} | ||
|
||
public init(container: Container) { | ||
self.container = container | ||
self.rootViewController = AddReviewViewController( | ||
container.resolve(AddReviewViewModel.self)!, | ||
state: .custom(height: 500) | ||
) | ||
} | ||
|
||
public func navigate(to step: Step) -> FlowContributors { | ||
guard let step = step as? AddReviewStep else { return .none } | ||
|
||
switch step { | ||
case .addReviewIsRequired: | ||
return navigateToAddReview() | ||
|
||
case .dismissToWritableReview: | ||
return dismissToWritableReview() | ||
} | ||
} | ||
} | ||
|
||
private extension AddReviewFlow { | ||
func navigateToAddReview() -> FlowContributors { | ||
return .one(flowContributor: .contribute( | ||
withNextPresentable: rootViewController, | ||
withNextStepper: rootViewController.viewModel | ||
)) | ||
} | ||
|
||
func dismissToWritableReview( | ||
) -> FlowContributors { | ||
self.rootViewController.dismissBottomSheet() | ||
return .none | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
Projects/Flow/Sources/MyPage/Review/WritableReviewFlow.swift
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,76 @@ | ||
import UIKit | ||
import Presentation | ||
import Swinject | ||
import RxFlow | ||
import Core | ||
import Domain | ||
|
||
public final class WritableReviewFlow: Flow { | ||
public let container: Container | ||
private let rootViewController: WritableReviewViewController | ||
public var root: Presentable { | ||
return rootViewController | ||
} | ||
|
||
public init(container: Container) { | ||
self.container = container | ||
self.rootViewController = container.resolve(WritableReviewViewController.self)! | ||
} | ||
|
||
public func navigate(to step: Step) -> FlowContributors { | ||
guard let step = step as? WritableReviewStep else { return .none } | ||
|
||
switch step { | ||
case .writableReviewIsRequired: | ||
return navigateToWritableReview() | ||
|
||
case .addReviewIsRequired: | ||
return navigateToAddReview() | ||
|
||
case .popToMyPage: | ||
return popToMyPage() | ||
} | ||
} | ||
} | ||
|
||
private extension WritableReviewFlow { | ||
func navigateToWritableReview() -> FlowContributors { | ||
return .one(flowContributor: .contribute( | ||
withNextPresentable: rootViewController, | ||
withNextStepper: rootViewController.viewModel | ||
)) | ||
} | ||
|
||
func navigateToAddReview() -> FlowContributors { | ||
let addReviewFlow = AddReviewFlow(container: container) | ||
Flows.use(addReviewFlow, when: .created) { root in | ||
let view = root as? AddReviewViewController | ||
view?.dismiss = { question, answer, techCode in | ||
self.rootViewController.viewModel.techCode = techCode.code | ||
self.rootViewController.viewModel.interviewReviewInfo.accept( | ||
QnaEntity( | ||
question: question, | ||
answer: answer, | ||
area: techCode.keyword | ||
) | ||
) | ||
} | ||
self.rootViewController.present( | ||
root, | ||
animated: false | ||
) | ||
} | ||
|
||
return .one(flowContributor: .contribute( | ||
withNextPresentable: addReviewFlow, | ||
withNextStepper: OneStepper( | ||
withSingleStep: AddReviewStep.addReviewIsRequired | ||
) | ||
)) | ||
} | ||
|
||
func popToMyPage() -> FlowContributors { | ||
self.rootViewController.navigationController?.popViewController(animated: true) | ||
return .none | ||
} | ||
} |
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
Oops, something went wrong.