by willtim · 9y ago · 0 comments
But yes, in Swift, arrays, dictionaries, sets and strings are all mutable. They are also value types, so mutation is a purely local effect.
let array = [1, 2, 3] var mutableArray = [4, 5, 6] var anotherMutable = array
Not sure how much optimisation is done under the hood, but Swift compiler loves to complain about mutable structures that are not ever edited.