Values & References15 / 16
Up next

Shared ownership

class Shared { var data = [1, 2, 3] }
let a = Shared()
// b and c are extra owners of the same instance
let b = a
let c = a
b.data.append(4)
// all three see the change
print(a.data, c.data)
What you're solving

several references to one object