Skip to content

Instantly share code, notes, and snippets.

@oisdk
Created June 30, 2015 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oisdk/24b84865af321d1c35aa to your computer and use it in GitHub Desktop.
Save oisdk/24b84865af321d1c35aa to your computer and use it in GitHub Desktop.
class SomeClass {
var a, b: Int
init(a: Int, b: Int) {
(self.a, self.b) = (a, b)
}
}
struct SomeStruct {
var a, b: Int
}
var cla = SomeClass (a: 1, b: 1)
var str = SomeStruct(a: 1, b: 1)
var ar1 = [cla]
var ar2 = [str]
cla.b = 2
str.b = 2
ar1 // [{a 1, b 2}]
ar2 // [{a 1, b 1}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment