@@ -35,23 +35,23 @@ @interface SPLStudyplusAPIRequest()
3535
3636@implementation SPLStudyplusAPIRequest
3737
38- - (id )init
38+ - (instancetype )init
3939{
4040 if (self = [super init ]) {
4141 _accessToken = nil ;
4242 }
4343 return self;
4444}
4545
46- + (SPLStudyplusAPIRequest* )newRequestWithAccessToken : (NSString *)accessToken
47- options : (NSDictionary *)options
46+ + (instancetype )newRequestWithAccessToken : (NSString *)accessToken
47+ options : (NSDictionary *)options
4848{
4949 return [[SPLStudyplusAPIRequest alloc ] initWithAccessToken: accessToken
5050 options: options];
5151}
5252
53- - (id )initWithAccessToken : (NSString *)accessToken
54- options : (NSDictionary *)options
53+ - (instancetype )initWithAccessToken : (NSString *)accessToken
54+ options : (NSDictionary *)options
5555{
5656 if (self = [super init ]) {
5757 _accessToken = accessToken;
@@ -64,7 +64,7 @@ - (void)postRequestWithPath:(NSString *)path
6464 requestParameter : (NSDictionary *)requestParameter
6565 completed : (void (^)(NSDictionary *response))completed
6666 failed : (void (^)(NSError *error))failed
67- {
67+ {
6868 [self sendRequestWithPath: path
6969 requestParams: requestParameter
7070 completed: completed
@@ -83,7 +83,7 @@ - (void)sendRequestWithPath:(NSString*)path
8383 failed : (void (^)(NSInteger httpStatusCode, NSError *error))failed
8484{
8585 AFHTTPResponseSerializer *responseSerializer = [AFHTTPResponseSerializer serializer ];
86- AFJSONRequestSerializer * requestSerializer = [AFJSONRequestSerializer serializer ];
86+ AFJSONRequestSerializer *requestSerializer = [AFJSONRequestSerializer serializer ];
8787 [requestSerializer setValue: [NSString stringWithFormat: @" OAuth %@ " , self .accessToken]
8888 forHTTPHeaderField: @" HTTP_AUTHORIZATION" ];
8989
@@ -119,14 +119,4 @@ - (NSString *)buildUrlFromPath:(NSString *)path
119119 return [NSString stringWithFormat: @" %@ v%ld /%@ " , [self apiBaseURL ], (long )self .apiVersion, path];
120120}
121121
122- + (NSOperationQueue *)sharedQueue
123- {
124- static NSOperationQueue *queue;
125- static dispatch_once_t onceToken;
126- dispatch_once (&onceToken, ^{
127- queue = [NSOperationQueue new ];
128- });
129- return queue;
130- }
131-
132122@end
0 commit comments