Created
May 8, 2019 13:14
-
-
Save VojtaStavik/26e679f3bb370269a5020b0717d33da2 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
var vc1: UIViewController? = .init() | |
weak var weakVC1 = vc1 | |
vc1 = nil | |
print(weakVC1 ?? "nil") | |
var vc2: UIViewController? = .init() | |
vc2?.loadViewIfNeeded() // Commenting this line out makes `weakVC2` nil, too. | |
weak var weakVC2 = vc2 | |
vc2 = nil | |
print(weakVC2 ?? "nil") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Console output is