-
Array
Bridge with NSArray
Type:
**Array<T> / [T] **, [T] is preferred
//Empty array
var arr1: [Int] = Int
var arr2: [Int] = []//Using initializer var arr3: [Double] = [Double](count: 3, repeatedValue: 0.0) //properties & methods arr3.count // 3 arr3.append(2.0) arr3.isEmpty arr3[0] arr3[0...3] = [1.0, 2.0] //the first fout elements will be replaced arr3.insert(3.0, atIndex: 0) arr3.removeAtIndex(0) arr3.removeLast() for i in arr3[0..<arr3.count] { //TODO } for (index, value) in arr3.enumerate() { //TODO }
Set
Bridge with NSSet