Created
December 20, 2019 08:50
-
-
Save bdsaglam/b84752159285d6c0c936b62be4e42203 to your computer and use it in GitHub Desktop.
Weak reference container in Swift
This file contains hidden or 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
| public final class WeakRef<T: AnyObject> { | |
| weak var object: T? | |
| init(_ object: T) { | |
| self.object = object | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment