I'm trying to write a swift method that returns a generic array. I've left out some of the details, but kept the important bit that isn't working for clarity...
protocol AProtocol {
func doSomething()
}
func decode<T: AProtocol>(jsonArray: Array<AnyObject>?) -> [T: AProtocol] {
//...
var resultArray = [T: AProtocol]()
resultArray.append
//...
}
When I specify that the array contains type T: AProtocol, then the append method no longer appears
[T: AProtocol] does not have a member named append