BlocksKit
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 includes: basic block calling; key value observing extensions; filtering and enumeration for mutable and immutable collections; NSInvocation from a block; block-based timers, controls, and gesture recognizers; block-based alert views and action sheets; and block-backed delegation alternatives to NSURLConnection, NSCache, MFMailComposeViewController, MFMessageComposeViewController, and UIWebView.
Dependencies
BlocksKit is a framework and static library for Mac OS X 10.6+ and iOS 4.0+. Use of BlocksKit on iOS requires linking against Core Graphics, MessageUI, and UIKit.
Installation
BlocksKit can be added to a project using CocoaPods, or through the methods described below.
Framework
- Download a release of BlocksKit.
- Move BlocksKit.framework to your project's folder. Drag it from there into your project.
- Add BlocksKit.framework to "Link Binary With Libraries" in your app's target. Make sure your app is linked with CoreGraphics, Foundation, MessageUI, and UIKit.
- In the build settings of your target or project, change "Other Linker Flags" (
OTHER_LDFLAGS) to-ObjC -all_load. - Insert
#import <BlocksKit/BlocksKit.h>in your project's prefix header. - Make amazing software.
Library
- Download a release of BlocksKit.
- Move libBlocksKit.a and Headers to your project's folder, preferably a subfolder like "Vendor".
- In "Build Phases", drag libBlocksKit.a into your target's "Link Binary With Libraries" build phase.
- In the build settings of your target or project, change "Other Linker Flags" to
-ObjC -all_load. Make sure your app is linked with CoreGraphics, Foundation, MessageUI, and UIKit. - Change (or add) to "Header Search Paths" the relative path to BlocksKit's headers, like
$(SRCROOT)/Vendor/Headers. - Insert
#import <BlocksKit/BlocksKit.h>in your project's prefix header.
Download
You can download this project in either zip or tar formats.
You can also clone the project with Git by running:
$ git clone git://github.com/zwaldowski/BlocksKit
Documentation
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 may also view the documentation online.
License
BlocksKit is created and maintained by Zachary Waldowski under the MIT license. 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. The license is reproduced below.
Copyright (c) 2011-2012 Zachary Waldowski, Alexsander Akers, and the BlocksKit Contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
All of the code included in BlocksKit is licensed either under BSD or MIT, or is otherwise in the public domain. You can use BlocksKit in any project, public or private, with or without attribution.
Credits
BlocksKit takes, repurposes, fiddles with, and groups together a variety of block-related code generally found on GitHub.
The following people (in alphabetical order) have their code lovingly enshrined in BlocksKit:
- 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
Specific credits exist in the header files and documentation.
Contributors
A special thanks are also extended to the following who have contributed to the project on GitHub.
- Muhammad Adil adil@itsaboutcode.com
- Aubrey Goodman aubrey.goodman@gmail.com
- Brian Doig brian.doig@me.com
- Dieter Komendera dieter@komendera.com
- David Linsin dlinsin@gmail.com
- Yasuhiro Inami inamiy@gmail.com
- Kai Wu kaiwu2004@gmail.com
- Martin Schürrer martin@schuerrer.org
- Scott Talbot s@chikachow.org
- Simon Blommegård simon@blommegard.se
- Stelian Iancu stelian.iancu@gmail.com
- Anthony Mittaz sync@me.com