![Hands-On Design Patterns with Swift](https://wfqqreader-1252317822.image.myqcloud.com/cover/72/36699072/b_36699072.jpg)
上QQ阅读APP看书,第一时间看更新
Arrays
Unlike in Objective-C, a Swift array can only hold elements of the same type, and it's a value type.
The following code declares an Array container of three Int types, 1, 2, and 3:
let ints = [1,2,3] // Array<Int> or [Int]
As an example, if you wanted them to be Doubles, you could easily force the type on it:
let doubles: [Double] = [1,2,3]