Created
July 20, 2017 07:32
-
-
Save alemar11/b6cad07889149d187420461dffc876af to your computer and use it in GitHub Desktop.
weakify
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 func weakify <T: AnyObject>(_ object: T) -> T? { | |
return { [weak object] in return object }() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment