Category: swift let var value reference type container
-
When a Swift immutable collection isn’t or is at least immutable-ish
Take the following code: struct Foo { var value: Int } let foo = [Foo(value: 1), Foo(value: 2)] By using ‘let foo’ an immutable array has been created. As such no members of this array can be replaced and nor can an element’s …
-
When a Swift immutable collection isn’t or is at least immutable-ish
Take the following code: struct Foo { var value: Int } let foo = [Foo(value: 1), Foo(value: 2)] By using ‘let foo’ an immutable array has been created. As such no members of this array can be replaced and nor can an element’s …