Skip to content

Instantly share code, notes, and snippets.

@jimrange
jimrange / gist:4eafec5b306ea0d4d81e
Created February 1, 2016 23:36 — forked from mralexgray/gist:5099927
Objective-C Blocks Cheat Sheet
// http://cocoawithlove.com/2009/10/ugly-side-of-blocks-explicit.html has a nice breakdown of the syntax--it helps to think of the ^ as similar to a pointer dereference symbol *
// block typedef:
typedef void(^Block)();
typedef void(^ConditionalBlock)(BOOL);
typedef NSString*(^BlockThatReturnsString)();
typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL);
// block property with typedef: