Created
January 25, 2018 01:53
-
-
Save koher/f80a6e54b750043c034e53fcfbe82901 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Person { | |
var name: String | |
var age: Int | |
} | |
var a = [ | |
Person(name: "Foo", age: 20), | |
Person(name: "Bar", age: 30), | |
] | |
var b = a | |
b[0].age += 1 | |
print(a[0].age) // 20 | |
print(b[0].age) // 21 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment