Skip to content

Instantly share code, notes, and snippets.

@yarneo
Created February 6, 2016 19:53
Show Gist options
  • Save yarneo/2a43514e9d8119d325e0 to your computer and use it in GitHub Desktop.
Save yarneo/2a43514e9d8119d325e0 to your computer and use it in GitHub Desktop.
struct Dog {
var name: String
var type: String
init(name: String, type: String) {
self.name = name
self.type = type
}
}
var aDog = Dog(name: "Bugsy", type: "Pug")
var bDog = aDog
bDog.name = "Mugsy" // Bugsy's brother
println(aDog.name) // "Bugsy"
println(bDog.name) // "Mugsy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment