+ 1
Are there only two ways of accessing arrays in swift?
Only .count and isEmpty can be used to access arrays?
5 odpowiedzi
+ 1
No, there are much more.
For example you can index them using square brackets:
array[0] and you will get the item at index 0
+ 1
Ok thanks but in solo learn course in accessing only these were given
+ 1
I found these: https://www.sololearn.com/learn/Swift/2387/
+ 1
There are other ways:
Example you can use the insert(at:) method to input values at a particular location.
Her is a code I made, and it should help you out.
https://code.sololearn.com/c8EC5cm47YRq/?ref=app
0
Oh, i got doubt from this:
https://www.sololearn.com/learn/Swift/2344/