Import UIKit
/*:
Array
* format var arr:[int] = [ value 1, value 2, value 3]
* non-variable group let = = Nsarray
* variable array var
*/
Let arr = [ten, one, one] // developed with this
Let arr2: [Int] = [ten, one, one]
Let arr3: Array<Int> = [ten, one, one]
Note : If the first definition is initialized , then the data type must be specified at the time of definition
var arr4:[Int]
ARR4 = [ten, one, one]
How to create an empty array
var arr5 = [Int] ()
cannot append content to immutable array
Arr.append (20)
Find
ARR4[0]
Modify
ARR4[0] =
Arr4
Append
ARR4. Append(998)
Delete
ARR4. Removeatindex(0)
Arr4
ARR4. RemoveAll()
Arr4
array Open Storage rules : multiples of 2
ARR4. Capacity
ARR4. Append(a)
ARR4. Capacity
ARR4. Append(one)
ARR4. Capacity
ARR4. Append(+)
ARR4. Capacity
ARR4. Append(+)
ARR4. Append(998)
ARR4. Capacity
ARR4. Append(998)
ARR4. Append(998)
ARR4. Append(998)
ARR4. Append(998)
ARR4. Capacity
Traverse
For number in arr4
{
Print(number)
}
Swift 2.0 Syntax Array