Wednesday 10 February 2016

How to declare an Array in Swift


arrayinswift.jpg

Hi Readers!
There are different ways to declare Array in Swift. I will write few examples below:
Example 1:
  1. let a : Array? = ["hello","hi"]
Now in above example this is a constant array. You cannot add/append an element in it.
Example 2: Below both versions of declaring array are same
  1. var a2 = Array<String>()
  2. var a3 = [String]()
Here is not the end….
See full Blog about How to Declare an Array in Swift visit Findnerd.

No comments:

Post a Comment