In objective c it is easy to create a heterogeneous array like this:
NSArray *myArray = @["String1", "String2", 123, 456];
Is there any way to create such an array in swift?
If yes then how?
Note: I tried similar statement in swift -
var arr = ["string1", "string2", 123, 456]
but it is giving compilation error:
Playground execution failed: error: <REPL>:124:17: error: cannot convert the expression's type 'Array' to type 'IntegerLiteralConvertible'
var arr : Any = ["string1", "string2", 123, 456]