Skip to content

Instantly share code, notes, and snippets.

@pgpt10 pgpt10/DeepShallow2.swift
Last active Jun 10, 2018

What would you like to do?
class Address
var city: String?
init(_ city: String?)
{ = city
var a1 = Address("Mumbai")
var a2 = a1 //This will create a Shallow Copy of a1
print( //Mumbai
print( //Mumbai = "Bangalore"
print( //Bangalore
print( //Bangalore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.