Skip to content

Commit

Permalink
Merge pull request #217 from BoltsFramework/nlutsenko.generics
Browse files Browse the repository at this point in the history
Specify generic type for BFTask.taskForCompletionOfAllTasks*().
  • Loading branch information
nlutsenko committed Jan 12, 2016
2 parents b1a6347 + 2e4f703 commit 3898418
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Bolts/Common/BFTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ typedef __nullable id(^BFContinuationBlock)(BFTask<ResultType> *task);
all of the input tasks have completed.
@param tasks An `NSArray` of the tasks to use as an input.
*/
+ (instancetype)taskForCompletionOfAllTasks:(nullable NSArray *)tasks;
+ (instancetype)taskForCompletionOfAllTasks:(nullable NSArray<BFTask *> *)tasks;

/*!
Returns a task that will be completed once all of the input tasks have completed.
If all tasks complete successfully without being faulted or cancelled the result will be
an `NSArray` of all task results in the order they were provided.
@param tasks An `NSArray` of the tasks to use as an input.
*/
+ (instancetype)taskForCompletionOfAllTasksWithResults:(nullable NSArray *)tasks;
+ (instancetype)taskForCompletionOfAllTasksWithResults:(nullable NSArray<BFTask *> *)tasks;

/*!
Returns a task that will be completed a certain amount of time in the future.
Expand Down
4 changes: 2 additions & 2 deletions Bolts/Common/BFTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ + (instancetype)cancelledTask {
return [[self alloc] initCancelled];
}

+ (instancetype)taskForCompletionOfAllTasks:(NSArray *)tasks {
+ (instancetype)taskForCompletionOfAllTasks:(NSArray<BFTask *> *)tasks {
__block int32_t total = (int32_t)tasks.count;
if (total == 0) {
return [self taskWithResult:nil];
Expand Down Expand Up @@ -166,7 +166,7 @@ + (instancetype)taskForCompletionOfAllTasks:(NSArray *)tasks {
return tcs.task;
}

+ (instancetype)taskForCompletionOfAllTasksWithResults:(NSArray *)tasks {
+ (instancetype)taskForCompletionOfAllTasksWithResults:(NSArray<BFTask *> *)tasks {
return [[self taskForCompletionOfAllTasks:tasks] continueWithSuccessBlock:^id(BFTask *task) {
return [tasks valueForKey:@"result"];
}];
Expand Down

0 comments on commit 3898418

Please sign in to comment.