Beware, this is also true for Set
and Dictionary
, when they contain values with reference semantics. Cocoa handles this with NSCopying; Swift prefers encouraging the use of value types instead.
4 Likes