SHARE
TWEET

Untitled

a guest May 27th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Address {
  2.   var fullAddress: String
  3.   var city: String
  4.  
  5.   init(fullAddress: String, city: String) {
  6.     self.fullAddress = fullAddress
  7.     self.city = city
  8.   }
  9. }
  10.  
  11. class Person {
  12.   var name: String
  13.   var address: Address
  14.  
  15.   init(name: String, address: Address) {
  16.     self.name = name
  17.     self.address = address
  18.   }
  19. }
  20.  
  21. var headquarters = Address(fullAddress: "123 Tutorial Street", city: "Appletown")
  22. var ray = Person(name: "Ray", address: headquarters)
  23. var brian = Person(name: "Brian", address: headquarters)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top