@@ -6,21 +6,21 @@ import KMPObservableViewModelSwiftUI
6
6
7
7
8
8
struct ContentView : View {
9
- let applicationCompoonent : IosApplicationComponent
9
+ let applicationComponent : IosApplicationComponent
10
10
11
11
@ObservedViewModel var viewModel : CountriesViewModelShared
12
12
@State var query : String = " "
13
13
14
- init ( applicationCompoonent : IosApplicationComponent ) {
15
- self . applicationCompoonent = applicationCompoonent
16
- self . viewModel = applicationCompoonent . countriesViewModel
14
+ init ( applicationComponent : IosApplicationComponent ) {
15
+ self . applicationComponent = applicationComponent
16
+ self . viewModel = applicationComponent . countriesViewModel
17
17
}
18
18
19
19
var body : some View {
20
20
NavigationView {
21
21
List {
22
22
ForEach ( viewModel. countryList. filter { query. isEmpty || $0. displayName. contains ( query) } , id: \. self) { country in
23
- NavigationLink ( destination: NetworkListView ( applicationCompoonent : applicationCompoonent , countryCode: country. code) ) {
23
+ NavigationLink ( destination: NetworkListView ( applicationComponent : applicationComponent , countryCode: country. code) ) {
24
24
HStack {
25
25
Text ( countryFlag ( from: country. code) )
26
26
Text ( country. displayName) . font ( . headline)
@@ -37,20 +37,20 @@ struct ContentView : View {
37
37
38
38
39
39
struct NetworkListView : View {
40
- let applicationCompoonent : IosApplicationComponent
40
+ let applicationComponent : IosApplicationComponent
41
41
let countryCode : String
42
42
43
43
@ObservedViewModel var viewModel : NetworksViewModelShared
44
44
45
- init ( applicationCompoonent : IosApplicationComponent , countryCode: String ) {
46
- self . applicationCompoonent = applicationCompoonent
45
+ init ( applicationComponent : IosApplicationComponent , countryCode: String ) {
46
+ self . applicationComponent = applicationComponent
47
47
self . countryCode = countryCode
48
- self . viewModel = applicationCompoonent . networksViewModel
48
+ self . viewModel = applicationComponent . networksViewModel
49
49
}
50
50
51
51
var body : some View {
52
52
List ( viewModel. networkList) { network in
53
- NavigationLink ( destination: StationListTabView ( applicationCompoonent : applicationCompoonent , network: network) ) {
53
+ NavigationLink ( destination: StationListTabView ( applicationComponent : applicationComponent , network: network) ) {
54
54
Text ( " \( network. name) ( \( network. city) ) " ) . font ( . subheadline)
55
55
}
56
56
}
@@ -63,15 +63,15 @@ struct NetworkListView: View {
63
63
64
64
65
65
struct StationListTabView : View {
66
- let applicationCompoonent : IosApplicationComponent
66
+ let applicationComponent : IosApplicationComponent
67
67
var network : Network
68
68
69
69
@ObservedViewModel var viewModel : StationsViewModelShared
70
70
71
- init ( applicationCompoonent : IosApplicationComponent , network: Network ) {
72
- self . applicationCompoonent = applicationCompoonent
71
+ init ( applicationComponent : IosApplicationComponent , network: Network ) {
72
+ self . applicationComponent = applicationComponent
73
73
self . network = network
74
- self . viewModel = applicationCompoonent . stationsViewModel
74
+ self . viewModel = applicationComponent . stationsViewModel
75
75
}
76
76
77
77
var body : some View {
0 commit comments