Skip to content

Commit 9bb042a

Browse files
committed
Fix the CaseStudies (UIKit)
1 parent 9ea8c76 commit 9bb042a

File tree

1 file changed

+54
-50
lines changed

1 file changed

+54
-50
lines changed

Examples/CaseStudies/UIKitCaseStudies/RootViewController.swift

Lines changed: 54 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,58 +12,62 @@ struct CaseStudy {
1212
}
1313
}
1414

15-
let dataSource: [CaseStudy] = [
16-
CaseStudy(
17-
title: "Basics",
18-
viewController: CounterViewController(
19-
store: Store(
20-
initialState: CounterState(),
21-
reducer: counterReducer,
22-
environment: CounterEnvironment()
23-
)
24-
)
25-
),
26-
CaseStudy(
27-
title: "Lists",
28-
viewController: CountersTableViewController(
29-
store: Store(
30-
initialState: CounterListState(
31-
counters: [
32-
CounterState(),
33-
CounterState(),
34-
CounterState(),
35-
]
36-
),
37-
reducer: counterListReducer,
38-
environment: CounterListEnvironment()
39-
)
40-
)
41-
),
42-
CaseStudy(
43-
title: "Navigate and load",
44-
viewController: EagerNavigationViewController(
45-
store: Store(
46-
initialState: EagerNavigationState(),
47-
reducer: eagerNavigationReducer,
48-
environment: EagerNavigationEnvironment(
49-
mainQueue: .main
15+
extension RootViewController {
16+
var dataSource: [CaseStudy] {
17+
[
18+
CaseStudy(
19+
title: "Basics",
20+
viewController: CounterViewController(
21+
store: Store(
22+
initialState: CounterState(),
23+
reducer: counterReducer,
24+
environment: CounterEnvironment()
25+
)
5026
)
51-
)
52-
)
53-
),
54-
CaseStudy(
55-
title: "Load then navigate",
56-
viewController: LazyNavigationViewController(
57-
store: Store(
58-
initialState: LazyNavigationState(),
59-
reducer: lazyNavigationReducer,
60-
environment: LazyNavigationEnvironment(
61-
mainQueue: .main
27+
),
28+
CaseStudy(
29+
title: "Lists",
30+
viewController: CountersTableViewController(
31+
store: Store(
32+
initialState: CounterListState(
33+
counters: [
34+
CounterState(),
35+
CounterState(),
36+
CounterState(),
37+
]
38+
),
39+
reducer: counterListReducer,
40+
environment: CounterListEnvironment()
41+
)
6242
)
63-
)
64-
)
65-
),
66-
]
43+
),
44+
CaseStudy(
45+
title: "Navigate and load",
46+
viewController: EagerNavigationViewController(
47+
store: Store(
48+
initialState: EagerNavigationState(),
49+
reducer: eagerNavigationReducer,
50+
environment: EagerNavigationEnvironment(
51+
mainQueue: .main
52+
)
53+
)
54+
)
55+
),
56+
CaseStudy(
57+
title: "Load then navigate",
58+
viewController: LazyNavigationViewController(
59+
store: Store(
60+
initialState: LazyNavigationState(),
61+
reducer: lazyNavigationReducer,
62+
environment: LazyNavigationEnvironment(
63+
mainQueue: .main
64+
)
65+
)
66+
)
67+
),
68+
]
69+
}
70+
}
6771

6872
final class RootViewController: UITableViewController {
6973
override func viewDidLoad() {

0 commit comments

Comments
 (0)