3 ms·
How? I don't know any way to do a bulk update of an immutable structure in Swift, apart from constructing an entirely new structure and passing all values (not
by ken 8y ago
How? I don't know any way to do a bulk update of an immutable structure in Swift, apart from constructing an entirely new structure and passing all values (not just changed ones) to its initializer.
- auggierose 8y agoYou can just declare all members of the structure as vars. The structure will still be immutable.