Created
October 15, 2019 14:20
-
-
Save uc-compass-bot/7d324073c4ff241109cbad6e0ec162db to your computer and use it in GitHub Desktop.
Catch Retain Cycles Weak Box
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 Foundation | |
class WeakBox<A: AnyObject> { | |
weak var unbox: A? | |
init(_ value: A) { | |
unbox = value | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment