Check out example codes for "create array with default value swift". It will help you in understanding the concepts better.

Code Example 1

var users = [User](count: howManyUsers, repeatedValue:User(thinkTime: 10.0))

Learn ReactJs, React Native from akashmittal.com