3. Overview
• Bolts was designed by Parse and Facebook
• Bolts is being used by FacebookSDK, ParseSDK and
also is a core of AWS SDK
• Release and open-source on Jan 30, 2014
• Organize complexity of asynchronous operations
• It’ just like a Promise in Javascript.
• Good bye to pyramid of doom of block. (Callback Hell)
4. Tasks
• BFTask takes care of managing dependencies for us.
Using NSOperation for dependency management, we
need declare all dependencies before starting an
operation.
NSOperation *networkingOperation = ...
NSOperation *resizingOperation = ...
[resizingOperation addDependency:networkingOperation];
• BFTasks release their dependencies while NSOperation
strongly retain its dependencies which would lead to a leak
or you can do it manually.
5. Tasks (cont.)
• BFTask allows you to perform branching, parallelism and
complex error handling.
• BFTasks keep track of the state of finished tasks: It tracks
whether there was a returned value, the task was
cancelled, or if an error occurred. With NSOperation, we
need to build everything manually.
6. Tasks (cont.)
• BFTask allows you to perform branching, parallelism and
complex error handling.
• BFTasks keep track of the state of finished tasks: It tracks
whether there was a returned value, the task was
cancelled, or if an error occurred. With NSOperation, we
need to build everything manually.