How does modifying an array work?

I have an array of a struct and I have to modify a property inside the struct whenever user switch between each index of the SegmentControl, for example:

// Struct
struct User {
var name: String
var age:Int }

// Array
var arrayUser = [User(name: "Alex", age: 23]

// Modify an array
arrayUser[0].age = 19

Will the array create a new copy every time I modify like this or it just reference to that particular element and make a modification?

Your response would be highly appreciated :)

AFAIK, for the change you list here, no new copy is created.

But if you extend the array, a new copy may be needed if you overpass the pre-reserved array memory size (the var will still be a pointer to the location of array memory area).

Get much more details here:
https://stackoverflow.com/questions/27943629/how-does-swift-manage-arrays-internally
How does modifying an array work?
 
 
Q