You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
struct PlanningView: View {
let store: Store<State, Action>
var body: some View {
NavigationView {
WithViewStore(store) { _ in
Text("Planning View Content")
}
}
}
}
Is there an out-of-the box way to handle this in ViewInspector?
I've been trying to extend ViewInspector to handle a ViewType.ViewWithStore.
When inspecting it like
let sut = PlanningView(store: store)
let val = sut.inspect().navigationView().viewWithStore(0, stateType: PlanningView.State.self, actionType: PlanningView.Action.self).text(0).string()
When you print the content of the NavigationView child, it's like WithViewStore<State, Action, Text>(content: (Function), _viewStore: SwiftUI.ObservedObject<ComposableArchitecture.ViewStore<NM.PlanningView.State, NM.PlanningView.Action>>(_seed: 0, wrappedValue: ComposableArchitecture.ViewStore<NM.PlanningView.State, NM.PlanningView.Action>))
I can extract the _viewStore properly, but can only extract the content as a generic mirror.child.value and can't even cast it to (Any) -> Any
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello. We're interested in using ViewInspector along with The Composable Architecture (https://github.com/pointfreeco/swift-composable-architecture). As a first trial, I've been trying to inspect views built using their
Using this simplified main view
Is there an out-of-the box way to handle this in ViewInspector?
I've been trying to extend ViewInspector to handle a ViewType.ViewWithStore.
When inspecting it like
When you print the content of the NavigationView child, it's like
WithViewStore<State, Action, Text>(content: (Function), _viewStore: SwiftUI.ObservedObject<ComposableArchitecture.ViewStore<NM.PlanningView.State, NM.PlanningView.Action>>(_seed: 0, wrappedValue: ComposableArchitecture.ViewStore<NM.PlanningView.State, NM.PlanningView.Action>))
I can extract the
_viewStore
properly, but can only extract thecontent
as a generic mirror.child.value and can't even cast it to(Any) -> Any
Thanks for your help.
Beta Was this translation helpful? Give feedback.
All reactions