​Swift is really a powerful and instinctive development language for macOS, iOS, watchOS and t...

Page 169

Swift

let mark = 98

println(stname) println(mark) When we run the above program using playground, we get the following result: swift 98

ARC Strong Reference Cycles Class Instances class studmarks { let name: String var stud: student?

init (name: String) { println("Initializing: \(name)") self.name = name }

deinit { println("Deallocating: \(self.name)") } }

class student { let name: String var strname: studmarks?

init (name: String) { println("Initializing: \(name)") self.name = name }

deinit { println("Deallocating: \(self.name)") 157


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.