In Xcode 12:
I have a protocol:
I then have several structs conforming to this protocol:
I have a ParameterView that takes a parameter and builds out a view:
Then I have a ParametersView (multiple parameters together now) that uses multiple parameters:
The compiler does not like this:
Any assistance would be appreciated
I have a protocol:
Code Block swift protocol Parameter { }
I then have several structs conforming to this protocol:
Code Block swift struct Temperature: Parameter { } ...
I have a ParameterView that takes a parameter and builds out a view:
Code Block swift struct ParameterView: View { @Binding var parameter: Parameter ... }
Then I have a ParametersView (multiple parameters together now) that uses multiple parameters:
Code Block swift struct ParametersView: View { @Binding var temperature: Temperature var body: some View { VStack(alignment: .leading) { ParameterView(parameter: $temperature) ... } } }
The compiler does not like this:
I must be violating something, but being a little rusty, I cannot determine if this is expected behavior or a compiler problem or something I completely messed up.Cannot convert value of type 'Binding<Temperature>' to expected argument type 'Binding<Parameter>'
Any assistance would be appreciated