Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify generic type for BFTask.taskForCompletionOfAllTasks*(). #217

Merged
merged 1 commit into from
Jan 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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