Last active
May 8, 2019 11:45
-
-
Save VojtaStavik/2cb2a7848b75a2da9392c4fca29cd27f 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
class Object { } | |
var a: Object? = Object() | |
weak var weakA = a | |
a = nil | |
print(a ?? "nil") | |
print(weakA ?? "nil") | |
print("-------------------------------------------------") | |
var b: Object? | |
b = Object() | |
weak var weakB = b | |
b = nil | |
print(b ?? "nil") | |
print(weakB ?? "nil") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The console output is