I\'m trying to add a tuple (e.g., 2-item tuple) to an array.
var myStringArray: (String,Int)[]? = nil
myStringArray += (\"One\", 1)
What I\'m g
I've ended up here multiple times due to this issue. Still not as easy as i'd like with appending onto an array of tuples. Here is an example of how I do it now.
Set an alias for the Tuple - key point
typealias RegionDetail = (regionName:String, constraintDetails:[String:String]?)
Empty array
var allRegionDetails = [RegionDetail]()
Easy to add now
var newRegion = RegionDetail(newRegionName, constraints)
allRegionDetails.append(newRegion)
var anotherNewRegion = RegionDetail("Empty Thing", nil)
allRegionDetails.append(anotherNewRegion)