I\'m trying to find the best way to merge Swift arrays, that are not of same type, but they have same superclass. I\'ve already read all the tutorials so I know I can use:>
If C inherits from A then you can "upcast" an array of type [C] to an array of type [A]
C
A
[C]
[A]
array += anotherArray as [A]
Alternatively, use (tested with Swift 4)
array.append(contentsOf: anotherArray)