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

ADD:add __kindof type #272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion YTKNetwork/YTKBatchRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface YTKBatchRequest : NSObject

/// All the requests are stored in this array.
@property (nonatomic, strong, readonly) NSArray<YTKRequest *> *requestArray;
@property (nonatomic, strong, readonly) NSArray<__kindof YTKRequest *> *requestArray;

/// The delegate object of the batch request. Default is nil.
@property (nonatomic, weak, nullable) id<YTKBatchRequestDelegate> delegate;
Expand Down
10 changes: 5 additions & 5 deletions YTKNetworkDemo/YTKNetworkDemo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ - (void)sendBatchRequest {
YTKBatchRequest *batchRequest = [[YTKBatchRequest alloc] initWithRequestArray:@[a, b, c, d]];
[batchRequest startWithCompletionBlockWithSuccess:^(YTKBatchRequest *batchRequest) {
NSLog(@"succeed");
NSArray *requests = batchRequest.requestArray;
GetImageApi *a = (GetImageApi *)requests[0];
GetImageApi *b = (GetImageApi *)requests[1];
GetImageApi *c = (GetImageApi *)requests[2];
GetUserInfoApi *user = (GetUserInfoApi *)requests[3];
NSArray<__kindof YTKRequest *> *requests = batchRequest.requestArray;
GetImageApi *a = requests[0];
GetImageApi *b = requests[1];
GetImageApi *c = requests[2];
GetUserInfoApi *user = requests[3];
// deal with requests result ...
NSLog(@"%@, %@, %@, %@", a, b, c, user);
} failure:^(YTKBatchRequest *batchRequest) {
Expand Down