To cast an integer array to Swift array in Swift, you can do the following:
main.swift72 chars3 lines
In this example, we declare an integer array integerArray
with 5 elements. To cast this to a Swift array, we use the built-in Array
constructor and pass in the integer array as an argument. The resulting variable swiftArray
is now a Swift array.
gistlibby LogSnag