Last active
May 21, 2018 18:11
-
-
Save dineshba/b588d41b57d4e697bb0d9feeeafc8165 to your computer and use it in GitHub Desktop.
This file contains 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 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