I'm trying to modify an existing struct which is then used with an array. Is there a solution to the following?
struct pickerData {
var key = ""
var value = ""
}
var pickerArray = [pickerData]()
pickerArray.append(pickerData(key: "1", value: "2")) //OK up to know but
//I need to append a new key:value to this structure
pickerArray.append(pickerData(key: "1", value: "2",value2: "3")) // error
pickerArray.append(pickerData(key: "1", value: "2"),value2: "3") // error
I basically need a mutable struct, is this doable?
pickerDatawith more properties? This isn't possible – it could be that you wantpickerData.valueto be anArrayorDictionary