What is the propose of `inspect` on RootViewApparence?
amadeu01 opened this issue · comments
When and why inspection = PassthroughSubject<((AnyView) -> Void), Never>()
is used on RootViewApparence
?
clean-architecture-swiftui/CountriesSwiftUI/UI/RootViewModifier.swift
Lines 24 to 26 in 7ef2ab4
I was checking ce82dfe however I am not sure if that was added only due to tests.
Another thing that kept me wondering what is the utility of that property is that you have used ViewInspector on other parts of the project. Wouldn't be the case of using ViewInspector for testing the RootViewApparence as well ?
Hey @amadeu01 sorry for the late response. Correct, that thing is used purely in tests by the ViewInspector, and this is a necessary workaround to make RootViewApparence
testable, since that modifier is using @State
(more info about it in the ViewInspector guide).