var array1 = [1, 2, 3, 4, 5]
var array2 = array1
array2.append(6)
var len = array1.count
class Master {
lazy var detail: Detail = Detail(master: self)
init() {
println("Master init")
}
deinit {
println("Master deinit")
}
}
class Detail {
var master: Master
init(master: Master) {
println("Detail init")
self.master = master
}
deinit {
println("Detail deinit")
}
}
func createMaster() {
var master: Master = Master()
var detail = master.detail
}
createMaster()
class MainViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
print("MainViewController :", "viewDidLoad")
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
print("MainViewController :", "viewWillLayoutSubviews")
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
print("MainViewController :", "viewDidLayoutSubviews")
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
print("MainViewController :", "viewWillAppear")
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
print("MainViewController :", "viewDidAppear")
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
print("MainViewController :", "viewWillDisappear")
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
print("MainViewController :", "viewDidDisappear")
}
deinit {
print("MainViewController :", "deinit")
}
}
class ViewControllerTwo: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
print("ViewControllerTwo :", "viewDidLoad")
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
print("ViewControllerTwo :", "viewWillLayoutSubviews")
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
print("ViewControllerTwo :", "viewDidLayoutSubviews")
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
print("ViewControllerTwo :", "viewWillAppear")
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
print("ViewControllerTwo :", "viewDidAppear")
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
print("ViewControllerTwo :", "viewWillDisappear")
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
print("ViewControllerTwo :", "viewDidDisappear")
}
deinit {
print("ViewControllerTwo :", "deinit")
}
}