​Fast is really a strong and instinctive coding language for macOS, iOS, watchOS and tvOS....

Page 171

Swift

init(number: Int) { self.number = number }

weak var topic: module?

deinit { println("Sub Module with its topic number is \(number)") } }

var toc: module? var list: submodule? toc = module(name: "ARC") list = submodule(number: 4) toc!.sub = list list!.topic = toc

toc = nil list = nil When we run the above program using playground, we get the following result: ARC Is The Main Module Sub Module with its topic number is 4

Unowned Reference Program class student { let name: String var section: marks?

init(name: String) { self.name = name }

deinit { println("\(name)") } } class marks { let marks: Int 159


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