Below I have pasted code which you should be able to paste into a Swift 3 playground and see the error.
I have a protocol defined and create an empty array of that t
Your trying to append an array when collection is only expecting individual items. For example, changing collection to this compiles:
var collection = [[MyProtocol]]()
here is a way you can go about adding two arrays together:
func merge(items: inout [T], with otherItems: inout [T]) -> [T] {
return items + otherItems
}
var myClassCollection = [MyClass(), MyClass()]
var myClassCollection2 = [MyClass(), MyClass()]
let combinedArray = merge(items: &myClassCollection, with: &myClassCollection2)