Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
Add Comment
Please, Sign In to add comment