Checking Objective-C block type?

Can do, kinda sorta. But first, let’s disambiguate. -[NSObject isKindOfClass:] can tell you it’s a block, and that’s about it. E.g. I believe this line of code — ostensibly & unfortunately A BAD IDEA — will return YES for blocks on present Lion & iOS 5.x: [myBlock isKindOfClass:NSClassFromString(@”NSBlock”)] That won’t help you distinguish the block’s … Read more

Updating closures to Swift 3 – @escaping

Swift 3: closure parameter attributes are now applied to the parameter type, and not the parameter itself Prior to Swift 3, the closure attributes @autoclosure and @noescape used to be attributes to the closure parameter, but are now attributes to the parameter type; see the following accepted Swift evolution proposal: SE-0049: Move @noescape and @autoclosure … Read more