countingUp.reverse() -> ReverseRandomAccessCollection

The book says

let countingDown = countingUp.reverse()         ["three", "two", "one"]

but it seems that in XCode 7

let countingDown = countingUp.reverse()         ReverseRandomAccessCollection<Array<String>>

Subscripting

doesn’t seem to work and shows error “Cannot subscript a value of type ‘ReverseRandomAccessCollection<[String]>’”


or

[code]var countingDown:Array = countingUp.reverse()[/code]

works

or

works

This also worked:

let countingDown = [String](countingUp.reverse())

Since updating to Xcode 8 it now uses “reversed”, so that:

var countingDown:Array = countingUp.reversed()