In Swift, I\'m trying to do the following:
struct Foo { var bar = 1 func baz() { bar = 2 } }
Xcode reports the error <
If you want to modify the properties of the struct, mark the function as mutating.
struct Foo { var bar = 1 mutating func baz() { bar = 2 } }