Answer the question
In order to leave comments, you need to log in
How to track changes in an array, split into insert/delete and update?
Live example, let's declare an array: var array = [John, Omega, Alpha, Toster]
Something happened and the array changed: var newArray = [John, Alpha, Toster]
We need to get the difference, an element was removed from the array at index 1, added at index..., modified at index...
It is necessary to show changes in the table animatedly using insert methods, delete & reload, and I don’t want to pull the reactive for this.
Answer the question
In order to leave comments, you need to log in
["John", "Alpha", "Toster"]
.difference(from: ["John", "Omega", "Alpha", "Toster"])
.forEach { print($0) }
// remove(offset: 1, element: "Omega", associatedWith: nil)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question