Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track Kaluga-SwiftUI #825

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions example/ios/Demo/Architecture/ArchitectureView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ struct ArchitectureView: View {
}
}
.padding(10.0)
.navigation(state: contentRoutingState, type: .push) {
switch contentRoutingState.object {
.navigation(state: contentRoutingState, type: .push) { route in
switch route.object {
case let .details(input): ArchitectureDetailsView(inputDetails: input) { result in
viewModel.nameInput.post(newValue: result.name as NSString)
viewModel.numberInput.post(newValue: NSString.init(format: "%d", result.number))
}.equatable()
.environmentObject(contentRoutingState as RoutingState)
.environmentObject(route as RoutingState)
default: EmptyView()
}
}
.navigation(state: bottomSheetRoutingState, type: .partialSheet(style: PSIphoneStyle.defaultStyle())) {
BottomSheetView().equatable().environmentObject(bottomSheetRoutingState)
.navigation(state: bottomSheetRoutingState, type: .partialSheet(style: PSIphoneStyle.defaultStyle())) { route in
BottomSheetView().equatable().environmentObject(route)
}
.navigationTitle("feature_architecture".localized())
}
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Demo/Architecture/BottomSheetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ struct BottomSheetView: View, Equatable {
Text(viewModel.text)
viewModel.button.toButton(buttonFrame: .frame(maxWidth: .infinity))
}.padding(10.0)
.navigation(state: nextRoute, type: .push) {
BottomSheetSubPageView().environmentObject(BottomSheetSubPageView.RouteStack(previousRoute: nextRoute, parentRoute: previousRoute))
.navigation(state: nextRoute, type: .push) { [unowned previousRoute] route in
BottomSheetSubPageView().environmentObject(BottomSheetSubPageView.RouteStack(previousRoute: route, parentRoute: previousRoute))
}
.navigationViewStyle(.stack)
.navigationBarItems(
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Demo/Bluetooth/BluetoothListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ struct BluetoothListView: View {
id: device.identifierString,
type: .sheet,
didSelect: { },
content: {
if let route = deviceRoute.object {
switch route {
content: { route in
if let object = route.object {
switch object {
case .details(let uuid): BluetoothDeviceDetailsView(identifier: uuid).equatable()
}
}
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Demo/Resources/ResourcesListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ struct ResourcesListView: View {
}
}
}
.navigation(state: navigationState, type: .push) {
switch navigationState.object {
.navigation(state: navigationState, type: .push) { state in
switch state.object {
case .buttons: ButtonView().equatable() // For lifecycle subviews it is recommended to use equatable
case .labels: LabelView()
case .images: ImagesView()
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Demo/Scientific/ScientificConverterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ struct ScientificConverterView: View, Equatable {
}
}
.padding(10.0)
.navigation(state: nextRoute, type: .sheet) {
if let routeObject = nextRoute.object {
.navigation(state: nextRoute, type: .sheet) { route in
if let routeObject = route.object {
switch routeObject {
case let .leftUnit(quantity):
ScientificUnitSelectionView(quantity: quantity) { index in
viewModel.didSelectLeftUnit(unitIndex: index)
}
.equatable()
.environmentObject(nextRoute as RoutingState)
.environmentObject(route as RoutingState)
case let .rightUnit(quantity):
ScientificUnitSelectionView(quantity: quantity) { index in
viewModel.didSelectRightUnit(unitIndex: index)
}
.equatable()
.environmentObject(nextRoute as RoutingState)
.environmentObject(route as RoutingState)
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions example/ios/Demo/Scientific/ScientificView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,20 @@ struct ScientificView: View {
id: converter.id,
type: .push,
didSelect: converter.button.action
) {
if let route = converterRoute.object {
switch route {
) { route in
if let object = route.object {
switch object {
case let .converter(arguments): ScientificConverterView(arguments: arguments)
.equatable()
.environmentObject(converterRoute as RoutingState)
.environmentObject(route as RoutingState)
}
}
}
}
}
}
.padding(.horizontal, 10.0)
.navigation(state: route, type: .sheet) {
.navigation(state: route, type: .sheet) { route in
if let routeObject = route.object {
switch routeObject {
case let .leftUnit(quantity):
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Kaluga-SwiftUI
Loading