From 13e53a03f4d50169d0cf7f72d414753ae6b421ce Mon Sep 17 00:00:00 2001 From: hank <hank.zhang@proficientcity.com> Date: Tue, 22 Jan 2019 11:04:39 +0800 Subject: [PATCH] 添加V3.8.0 --- frameworks/Bolts.framework/Headers/BFTask.h | 73 ++++++++++++++---------------------- 1 files changed, 29 insertions(+), 44 deletions(-) diff --git a/frameworks/Bolts.framework/Headers/BFTask.h b/frameworks/Bolts.framework/Headers/BFTask.h index 3cd0405..074c182 100644 --- a/frameworks/Bolts.framework/Headers/BFTask.h +++ b/frameworks/Bolts.framework/Headers/BFTask.h @@ -11,6 +11,7 @@ #import <Foundation/Foundation.h> #import <Bolts/BFCancellationToken.h> +#import <Bolts/BFGeneric.h> NS_ASSUME_NONNULL_BEGIN @@ -25,21 +26,10 @@ extern NSInteger const kBFMultipleErrorsError; /*! - An exception that is thrown if there was multiple exceptions on <BFTask taskForCompletionOfAllTasks:>. - */ -extern NSString *const BFTaskMultipleExceptionsException; - -/*! An error userInfo key used if there were multiple errors on <BFTask taskForCompletionOfAllTasks:>. Value type is `NSArray<NSError *> *`. */ extern NSString *const BFTaskMultipleErrorsUserInfoKey; - -/*! - An error userInfo key used if there were multiple exceptions on <BFTask taskForCompletionOfAllTasks:>. - Value type is `NSArray<NSException *> *`. - */ -extern NSString *const BFTaskMultipleExceptionsUserInfoKey; @class BFExecutor; @class BFTask; @@ -54,7 +44,7 @@ /*! A block that can act as a continuation for a task. */ -typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *task); +typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *t); /*! Creates a task that is already completed with the given result. @@ -67,12 +57,6 @@ @param error The error for the task. */ + (instancetype)taskWithError:(NSError *)error; - -/*! - Creates a task that is already completed with the given exception. - @param exception The exception for the task. - */ -+ (instancetype)taskWithException:(NSException *)exception; /*! Creates a task that is already cancelled. @@ -96,7 +80,7 @@ /*! Returns a task that will be completed once there is at least one successful task. - The first task to successuly complete will set the result, all other tasks results are + The first task to successuly complete will set the result, all other tasks results are ignored. @param tasks An `NSArray` of the tasks to use as an input. */ @@ -107,7 +91,7 @@ @param millis The approximate number of milliseconds to wait before the task will be finished (with result == nil). */ -+ (instancetype)taskWithDelay:(int)millis; ++ (BFTask<BFVoid> *)taskWithDelay:(int)millis; /*! Returns a task that will be completed a certain amount of time in the future. @@ -115,7 +99,7 @@ task will be finished (with result == nil). @param token The cancellation token (optional). */ -+ (instancetype)taskWithDelay:(int)millis cancellationToken:(nullable BFCancellationToken *)token; ++ (BFTask<BFVoid> *)taskWithDelay:(int)millis cancellationToken:(nullable BFCancellationToken *)token; /*! Returns a task that will be completed after the given block completes with @@ -127,7 +111,7 @@ If block returns a BFTask, then the task returned from this method will not be completed until that task is completed. */ -+ (instancetype)taskFromExecutor:(BFExecutor *)executor withBlock:(nullable id (^)())block; ++ (instancetype)taskFromExecutor:(BFExecutor *)executor withBlock:(nullable id (^)(void))block; // Properties that will be set on the task once it is completed. @@ -142,17 +126,12 @@ @property (nullable, nonatomic, strong, readonly) NSError *error; /*! - The exception of a failed task. - */ -@property (nullable, nonatomic, strong, readonly) NSException *exception; - -/*! Whether this task has been cancelled. */ @property (nonatomic, assign, readonly, getter=isCancelled) BOOL cancelled; /*! - Whether this task has completed due to an error or exception. + Whether this task has completed due to an error. */ @property (nonatomic, assign, readonly, getter=isFaulted) BOOL faulted; @@ -172,7 +151,7 @@ If block returns a BFTask, then the task returned from this method will not be completed until that task is completed. */ -- (BFTask *)continueWithBlock:(BFContinuationBlock)block; +- (BFTask *)continueWithBlock:(BFContinuationBlock)block NS_SWIFT_NAME(continueWith(block:)); /*! Enqueues the given block to be run once this task is complete. @@ -186,7 +165,8 @@ If block returns a BFTask, then the task returned from this method will not be completed until that task is completed. */ -- (BFTask *)continueWithBlock:(BFContinuationBlock)block cancellationToken:(nullable BFCancellationToken *)cancellationToken; +- (BFTask *)continueWithBlock:(BFContinuationBlock)block + cancellationToken:(nullable BFCancellationToken *)cancellationToken NS_SWIFT_NAME(continueWith(block:cancellationToken:)); /*! Enqueues the given block to be run once this task is complete. @@ -197,7 +177,9 @@ If block returns a BFTask, then the task returned from this method will not be completed until that task is completed. */ -- (BFTask *)continueWithExecutor:(BFExecutor *)executor withBlock:(BFContinuationBlock)block; +- (BFTask *)continueWithExecutor:(BFExecutor *)executor + withBlock:(BFContinuationBlock)block NS_SWIFT_NAME(continueWith(executor:block:)); + /*! Enqueues the given block to be run once this task is complete. @param executor A BFExecutor responsible for determining how the @@ -210,11 +192,12 @@ */ - (BFTask *)continueWithExecutor:(BFExecutor *)executor block:(BFContinuationBlock)block - cancellationToken:(nullable BFCancellationToken *)cancellationToken; + cancellationToken:(nullable BFCancellationToken *)cancellationToken +NS_SWIFT_NAME(continueWith(executor:block:cancellationToken:)); /*! Identical to continueWithBlock:, except that the block is only run - if this task did not produce a cancellation, error, or exception. + if this task did not produce a cancellation or an error. If it did, then the failure will be propagated to the returned task. @param block The block to be run once this task is complete. @@ -222,11 +205,11 @@ If block returns a BFTask, then the task returned from this method will not be completed until that task is completed. */ -- (BFTask *)continueWithSuccessBlock:(BFContinuationBlock)block; +- (BFTask *)continueWithSuccessBlock:(BFContinuationBlock)block NS_SWIFT_NAME(continueOnSuccessWith(block:)); /*! Identical to continueWithBlock:, except that the block is only run - if this task did not produce a cancellation, error, or exception. + if this task did not produce a cancellation or an error. If it did, then the failure will be propagated to the returned task. @param block The block to be run once this task is complete. @@ -235,13 +218,14 @@ If block returns a BFTask, then the task returned from this method will not be completed until that task is completed. */ -- (BFTask *)continueWithSuccessBlock:(BFContinuationBlock)block cancellationToken:(nullable BFCancellationToken *)cancellationToken; +- (BFTask *)continueWithSuccessBlock:(BFContinuationBlock)block + cancellationToken:(nullable BFCancellationToken *)cancellationToken +NS_SWIFT_NAME(continueOnSuccessWith(block:cancellationToken:)); /*! Identical to continueWithExecutor:withBlock:, except that the block - is only run if this task did not produce a cancellation, error, or - exception. If it did, then the failure will be propagated to the - returned task. + is only run if this task did not produce a cancellation, error, or an error. + If it did, then the failure will be propagated to the returned task. @param executor A BFExecutor responsible for determining how the continuation block will be run. @param block The block to be run once this task is complete. @@ -249,13 +233,13 @@ If block returns a BFTask, then the task returned from this method will not be completed until that task is completed. */ -- (BFTask *)continueWithExecutor:(BFExecutor *)executor withSuccessBlock:(BFContinuationBlock)block; +- (BFTask *)continueWithExecutor:(BFExecutor *)executor + withSuccessBlock:(BFContinuationBlock)block NS_SWIFT_NAME(continueOnSuccessWith(executor:block:)); /*! Identical to continueWithExecutor:withBlock:, except that the block - is only run if this task did not produce a cancellation, error, or - exception. If it did, then the failure will be propagated to the - returned task. + is only run if this task did not produce a cancellation or an error. + If it did, then the failure will be propagated to the returned task. @param executor A BFExecutor responsible for determining how the continuation block will be run. @param block The block to be run once this task is complete. @@ -266,7 +250,8 @@ */ - (BFTask *)continueWithExecutor:(BFExecutor *)executor successBlock:(BFContinuationBlock)block - cancellationToken:(nullable BFCancellationToken *)cancellationToken; + cancellationToken:(nullable BFCancellationToken *)cancellationToken +NS_SWIFT_NAME(continueOnSuccessWith(executor:block:cancellationToken:)); /*! Waits until this operation is completed. -- Gitblit v1.8.0