Last active
December 15, 2015 12:09
-
-
Save Lascorbe/28f23736b39ef0d0f5e9 to your computer and use it in GitHub Desktop.
Closure copy (Disclaimer: I don't need to do this, I just want to know if it's possible :))
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
// OBJC | |
@property (nonatomic, copy) MyBlock myBlock; | |
- (void)makeSomethingWithCompletionBlock:(MyBlock)completionBlock | |
{ | |
self.myBlock = completionBlock; | |
} | |
// SWIFT | |
var myBlock: (()->String)?; | |
func makeSomethingWithCompletionBlock(completionBlock:()->String) { | |
myBlock = completionBlock // It's possible to make a copy at this point? And not just reference the closure? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment