Created
October 20, 2016 04:29
-
-
Save robertmryan/b7217bc9c6e296e55b6ff46de240cdd5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import os.log | |
// This reported: | |
// | |
// 2016-10-19 21:27:58.383124 MyApp[6452:1422313] about to set to `nil` | |
// 2016-10-19 21:27:58.383439 MyApp[6452:1422313] set to nil | |
// 2016-10-19 21:27:58.383711 MyApp[6452:1422313] finished setting to `nil` | |
class ViewController: UIViewController { | |
var foo: Foo? = Foo() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
DispatchQueue.main.asyncAfter(deadline: .now() + 5) { | |
os_log("about to set to `nil`") | |
self.foo = nil | |
os_log("finished setting to `nil`") | |
} | |
} | |
} | |
class Foo { | |
deinit { | |
os_log("set to nil") | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment