Skip to content

Instantly share code, notes, and snippets.

@Lascorbe
Last active December 15, 2015 12:09
Show Gist options
  • Save Lascorbe/28f23736b39ef0d0f5e9 to your computer and use it in GitHub Desktop.
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 :))
// 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