Hi Readers!
There are different ways to declare Array in Swift. I will write few examples below:
Example 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
- var a2 = Array<String>()
- var a3 = [String]()
Here is not the end….
No comments:
Post a Comment