struct Counter { var value = 0 // mutating is required to change a struct's own properties mutating func bump() { value += 1 } } var c = Counter() c.bump() c.bump() print(c.value)
a struct method that changes self