Blocks in C and Objective-C are downright magical. They make coding easier and potentially quicker, not to mention faster on the front end with multithreading and Grand Central Dispatch. BlocksKit hopes to facilitate this kind of programming by removing some of the annoying - and, in some cases, impeding - limits on coding with blocks.
BlocksKit is a framework andr static library for iOS 4.0+ and Mac OS X 10.6+.
- Performing blocks on an
NSObject, with or without delay.
- Key-value observation (
<NSKeyValueObserving>) with block handlers.
- Associated objects in an Obj-C API. (Not directly block-related.)
NSIndexSetfiltering and enumeration.
- Filtering for mutable collections.
NSInvocationcreation using a block.
- Both delegation and block callbacks on
- Delegate callback for
UIActionSheetwith block callbacks and convenience methods.
- Block initializers for
- Block initializers for
- On-touch utilities for
- Block callbacks for
- Delegate alternative for
BlocksKit can be added to a project using CocoaPods.
- Download a release of BlocksKit.
- Move BlocksKit.framework to your project's folder. Drag it from there into your project.
- In the build settings of your target or project, change "All Linker Flags" to
#import <BlocksKit/BlocksKit.h>in your project's prefix header.
- Make amazing software.
- Clone the repository.
- Check out the A2DynamicDelegate submodule using
git submodule update --init.
- Click-and-drag the BlocksKit project into a project or workspace.
- In the build phases of a target, add libBlocksKit.a to the "Target Dependencies" and "Link Binary with Libraries".
- In the build settings, change "All Linker Flags" to
-ObjCand "Header Search Paths" to
- In any header file, insert
#import "BlocksKit/BlocksKit.h". It is not recommended to insert the import statement in your project prefix, as it could break Xcode 4's Code Sense.
Documentation is exhaustive and done using AppleDoc.
An Xcode 4 compatible documentation set is available using this Atom link. Add it to Xcode 4's preferences and it'll download automatically.
You can also view the documentation online at my website.
BlocksKit is created and maintained by Zachary Waldowski under the MIT license (hello, nice to meet you). All of the included code is licensed either under BSD, MIT, or is in the public domain. The project itself is free for use in any and all projects. You can use BlocksKit in any project, public or private, with or without attribution.
Unsure about your rights? Read more.
BlocksKit takes, repurposes, fiddles with, and groups together a variety of block-related code generally found here on GitHub.
The following people (in alphabetical order) have their code lovingly enshrined in BlocksKit:
- Alexsander Akers.
- Michael Ash.
- Jiva DeVoe.
- Igor Evsukov.
- Corey Floyd.
- Landon Fuller.
- Mirko Kiefer.
- Robin Lu.
- Jake Marsh.
- Andy Matuschak.
- Aleks Nesterow.
- Kevin O'Neill.
- Jonathan Rentzch.
- Peter Steinberger.
- Jon Sterling.
- Martin Schürrer.
- Jonathan Wight.
Individual credits exist in the header files and documentation.