While I am playing with Swift Array I came across a problem.
Here below is my experiment:
var iArray = [] //Here if I see the type details in quick help it is of NSArray type. var myArray = [Int]() //Here if I see the type details in quick help it is of Swift Array<Int> type.
Now if I check like below
if iArray is NSArray { //it gives error saying it is always true, which is correct. println("Confused") } if iArray is Array<String> { //Here it is true and printing the message and same is also true if i check for Array<Int> println("More Confused") }
As per documentation, Swift Arrays are equivalent to NSArray
. Should I understand that quick help is giving wrong information? More explanation would be great at this point.