Skip to content

Instantly share code, notes, and snippets.

@dineshba
Last active May 21, 2018 18:11
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 dineshba/b588d41b57d4e697bb0d9feeeafc8165 to your computer and use it in GitHub Desktop.
Save dineshba/b588d41b57d4e697bb0d9feeeafc8165 to your computer and use it in GitHub Desktop.
struct Dog {
var name: String
var weight: Int
}
var myDog = Dog(name: "Ranger", weight: 10)
var yourDog = myDog //Deep copy
yourDog.name = "Puncher"
print(myDog) // Dog(name: "Ranger", weight: 10)
print(yourDog) // Dog(name: "Puncher", weight: 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment