BoltsFramework /Bolts-ObjC
Bolts is a collection of low-level libraries designed to make developing mobile apps easier.
★ 5,612⑂ 570👁 207⑃ 224● 127▤ 23
+0
日增长
5,612
stars
570
forks
207
watchers
224
prs
127
issues
23
releases
README
Bolts ============ Bolts is a collection of low-level libraries designed to make developing mobile apps easier. Bolts was designed by Parse and Facebook for our own internal use, and we have decided to open source these libraries to make them available to others. Using these libraries does not require using any Parse services. Nor do they require having a Parse or Facebook developer account. Bolts includes: "Tasks", which make organization of complex asynchronous code more manageable. A task is kind of like a JavaScript Promise, but available for iOS and Android. An implementation of the App Links protocol, helping you link to content in other apps and handle incoming deep-links. For more information, see the Bolts iOS API Reference. Tasks To build a truly responsive iOS application, you must keep long-running operations off of the UI thread, and be careful to avoid blocking anything the UI thread might be waiting on. This means you will need to execute various operations in the background. To make this easier, we've added a class called BFTask. A task represents the result of an asynchronous operation. Typically, a BFTask is returned from an asynchronous function and gives the ability to continue processing the result of the task. When a task is returned from a function, it's already begun doing its job. A task is not tied to a particular threading model: it represents the work being done, not where it is executing. Tasks have many advantages over other methods of asynchronous programming, such as callbacks. BFTask is not a replacement for NSOperation or GCD. In fact, they play well together. But tasks do fill in some gaps that those technologies don't address. BFTask takes care of managing dependencies for you. Unlike using NSOperation for dependency management, you don't have to declare all dependencies before starting a BFTask. For example, imagine you need to save a set of objects and each one may or may not require saving child objects. With an NSOperation, you would normally have to create operations for each of the child saves ahead of time. But you don't always know before you start the work whether that's going to be necessary. That can make managing dependencies with NSOperation very painful. Even in the best case, you have to create your dependencies before the operations that depend on them, which results in code that appears in a different order than it executes. With BFTask, you can decide during your operation's work whether there will be subtasks and return the other task in just those cases. BFTasks release their dependencies. NSOperation strongly retains its dependencies, so if you have a queue of ordered operations and sequence them using dependencies, you have a leak, because every operation gets retained forever. BFTasks release their callbacks as soon as they are run, so everything cleans up after itself. This can reduce memory use, and simplify memory management. BFTasks keep track of the state of finis
Top issues
#325Next Version Release?5 comments · 2018-10-24#272`[BFTask taskForCompletionOfAllTasksWithResults:tasks]` (BUT IN SERIES)5 comments · 2016-07-15#249Memory leak?5 comments · 2016-05-19#117Allow setting the result of a task completion source from an existing task.4 comments · 2015-08-10#38BFAppLinkNavigation methods with custom URL scheme not working4 comments · 2014-06-10#34Using NSProgress as a Cancellation Token4 comments · 2014-05-18#344Crash BFTask.m - Line 54 Crashed: com.parse.asynctaskqueue.sync SIGABRT ABORT 0x00000001b70da95c3 comments · 2020-11-07#3267 Semantic Issues in XCode 10.1 with Bolts 1.9.03 comments · 2019-01-06
Latest release
1.9.1 1.9.1 2020-04-16Merged pull requests: - UIWebView - WKWebView \334 (roremeol) Closed issues: - Apple Review \331 - Need the Bolts framework with mac catalyst support \333