Skip to content

Commit 696f298

Browse files
authored
๐Ÿ”— :: (#138) ๋ฒ„๊ทธ์ œ๋ณด ๊ฐœ๋ฐœ
๐Ÿ”— :: (#138) ๋ฒ„๊ทธ์ œ๋ณด ๊ฐœ๋ฐœ
2 parents 11d063d + 9173b16 commit 696f298

38 files changed

+1391
-24
lines changed

โ€Ž.mise.tomlโ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tools]
2+
tuist = "3.40.0"

โ€Ž.tuist-versionโ€Ž

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import RxFlow
2+
3+
public enum BugReportListStep: Step {
4+
case bugReportListIsRequired
5+
case majorBottomSheetIsRequired
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import RxFlow
2+
3+
public enum BugReportStep: Step {
4+
case bugReportIsRequired
5+
case majorBottomSheetIsRequired
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import RxFlow
2+
3+
public enum MajorBottomSheetStep: Step {
4+
case majorBottomSheetIsRequired
5+
case dismissToBugReport
6+
}

โ€ŽProjects/Core/Sources/Steps/MyPageStep.swiftโ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ public enum MyPageStep: Step {
66
case writableReviewIsRequired(_ id: Int)
77
case noticeIsRequired
88
case confirmIsRequired
9+
case bugReportIsRequired
10+
case bugReportListIsRequired
911
}

โ€ŽProjects/Flow/Sources/Home/EasterEggFlow.swiftโ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Swinject
55
import RxFlow
66
import Core
77

8-
98
public final class EasterEggFlow: Flow {
109
public let container: Container
1110
private let rootViewController: RxFlowViewController
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import UIKit
2+
import Presentation
3+
import Swinject
4+
import RxFlow
5+
import Core
6+
7+
public final class BugReportFlow: Flow {
8+
public let container: Container
9+
private let rootViewController: BugReportViewController
10+
public var root: Presentable {
11+
return rootViewController
12+
}
13+
14+
public init(container: Container) {
15+
self.container = container
16+
self.rootViewController = container.resolve(BugReportViewController.self)!
17+
}
18+
19+
public func navigate(to step: Step) -> FlowContributors {
20+
guard let step = step as? BugReportStep else { return .none }
21+
22+
switch step {
23+
case .bugReportIsRequired:
24+
return navigateToBugReport()
25+
26+
case .majorBottomSheetIsRequired:
27+
return navigateToMajorBottomSheet()
28+
}
29+
}
30+
}
31+
32+
private extension BugReportFlow {
33+
func navigateToBugReport() -> FlowContributors {
34+
return .one(flowContributor: .contribute(
35+
withNextPresentable: rootViewController,
36+
withNextStepper: rootViewController.viewModel
37+
))
38+
}
39+
40+
func navigateToMajorBottomSheet() -> FlowContributors {
41+
let majorBottomSheetFlow = MajorBottomSheetFlow(container: container)
42+
Flows.use(majorBottomSheetFlow, when: .created) { root in
43+
let view = root as? MajorBottomSheetViewController
44+
view?.dismiss = { majorType in
45+
self.rootViewController.viewModel.majorType.accept(majorType)
46+
}
47+
self.rootViewController.present(
48+
root,
49+
animated: false
50+
)
51+
}
52+
53+
return .one(flowContributor: .contribute(
54+
withNextPresentable: majorBottomSheetFlow,
55+
withNextStepper: OneStepper(
56+
withSingleStep: MajorBottomSheetStep.majorBottomSheetIsRequired
57+
)
58+
))
59+
}
60+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//import UIKit
2+
//import Presentation
3+
//import Swinject
4+
//import RxFlow
5+
//import Core
6+
//
7+
//public final class BugReportListFlow: Flow {
8+
// public let container: Container
9+
// private let rootViewController: BugReportListViewController
10+
// public var root: Presentable {
11+
// return rootViewController
12+
// }
13+
//
14+
// public init(container: Container) {
15+
// self.container = container
16+
// self.rootViewController = container.resolve(BugReportListViewController.self)!
17+
// }
18+
//
19+
// public func navigate(to step: Step) -> FlowContributors {
20+
// guard let step = step as? BugReportListStep else { return .none }
21+
//
22+
// switch step {
23+
// case .bugReportListIsRequired:
24+
// return navigateToBugReportList()
25+
//
26+
// case .majorBottomSheetIsRequired:
27+
// return navigateToMajorBottomSheet()
28+
// }
29+
// }
30+
//}
31+
//
32+
//private extension BugReportListFlow {
33+
// func navigateToBugReportList() -> FlowContributors {
34+
// return .one(flowContributor: .contribute(
35+
// withNextPresentable: rootViewController,
36+
// withNextStepper: rootViewController.viewModel
37+
// ))
38+
// }
39+
//
40+
// func navigateToMajorBottomSheet() -> FlowContributors {
41+
// let majorBottomSheetFlow = MajorBottomSheetFlow(container: container)
42+
//
43+
// Flows.use(majorBottomSheetFlow, when: .created) { (root) in
44+
// let view = root as? MajorBottomSheetViewController
45+
// self.rootViewController.present(
46+
// root,
47+
// animated: false
48+
// )
49+
// }
50+
//
51+
// return .one(flowContributor: .contribute(
52+
// withNextPresentable: majorBottomSheetFlow,
53+
// withNextStepper: OneStepper(withSingleStep: MajorBottomSheetStep.majorBottomSheetIsRequired)
54+
// ))
55+
// }
56+
//}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import UIKit
2+
import Presentation
3+
import Swinject
4+
import RxFlow
5+
import Core
6+
7+
public final class MajorBottomSheetFlow: Flow {
8+
public let container: Container
9+
private let rootViewController: MajorBottomSheetViewController
10+
public var root: Presentable {
11+
return rootViewController
12+
}
13+
14+
public init(container: Container) {
15+
self.container = container
16+
self.rootViewController = MajorBottomSheetViewController(
17+
container.resolve(MajorBottomSheetViewModel.self)!,
18+
state: .custom(height: 300)
19+
)
20+
}
21+
22+
public func navigate(to step: Step) -> FlowContributors {
23+
guard let step = step as? MajorBottomSheetStep else { return .none }
24+
25+
switch step {
26+
case .majorBottomSheetIsRequired:
27+
return navigateToMajorBottomSheet()
28+
29+
case .dismissToBugReport:
30+
return dismissToBugReport()
31+
}
32+
}
33+
}
34+
35+
private extension MajorBottomSheetFlow {
36+
func navigateToMajorBottomSheet() -> FlowContributors {
37+
return .one(flowContributor: .contribute(
38+
withNextPresentable: rootViewController,
39+
withNextStepper: rootViewController.viewModel
40+
))
41+
}
42+
43+
func dismissToBugReport() -> FlowContributors {
44+
self.rootViewController.dismissBottomSheet()
45+
return .none
46+
}
47+
}

0 commit comments

Comments
ย (0)