I trying to update property of an object in an array and it doesn't work. I tried replacing the whole object in the array, but it didn't help
let object = myArray[0]
object.property = "new value"
myArray[0] = object
print(object.property) //"new value"
let sameObject = myArray[0]
print(sameObject.property) //"old value"
EDIT: I found it!!! The array was singelton property. I was calling MyClass().myArray, instead of calling MyClass.sharedInstance.myArray