If you don't know the types of the array's elements in the "channel" at compile-time, then I would recommend that you convert them to the widest number type among all of the possible types in the channel. For example, if the channel could contain Int32 or Int64 number types, then your array in Swift should always contain elements of type Int64, because this is the wider type. Just convert values of type Int32 to Int64 when initializing the Swift array from the channel data.