Hard to remember all those different ways to type a block in Objective-C, isn't it?
Just install these snippets and you can type BLOCK
anywhere to auto-complete with a block syntax fit for the context you're currently in.
$ zsh -c 'unzip -ouj -d ~/Library/Developer/Xcode/UserData/CodeSnippets/ =(curl -L https://github.com/JohnSundell/BlockSnippets/zipball/master) "*.codesnippet"'
The above will download a zip archive of this repo, and move the files into your CodeSnippets folder that Xcode reads from.
After you've cloned the repo, here's how to get these snippets into Xcode:
-
Drag the .codesnippet files into
~/Library/Developer/Xcode/UserData/CodeSnippets/
-
Restart Xcode
Congratulations, you're done! Now, try typing BLOCK
anywhere in the editor (where a block can be put).
Why not give me a shout on Twitter: @johnsundell