Here is protocol I am using,
public protocol PValidationCondition: Equatable {
associatedtype T
func isValid(value: T) -> Bool
func errorMessage() -> String
}
This is model I am using:
struct PValidationElementWithConditions<T: PValidationCondition> {
let validationElement: PValidationElement
var conditions: [T] = []
}
But I would like to store the multiple object in array like the following:
var validationElementsWithConditions: [String: PValidationElementWithConditions] = [:]
But I am getting the following error:
"Cannot convert value of type '[String : PValidationElementWithConditions<_>]' to specified type '[String : PValidationElementWithConditions]'"