@@ -52,6 +52,11 @@ platform :ios, '7.0'
5252pod ' STNetTaskQueue'
5353```
5454
55+ ### Carthage
56+ ``` ruby
57+ github " kevin0571/STNetTaskQueue"
58+ ```
59+
5560### Use STNetTaskQueue in your project
5661#### Step 1: Setup STNetTaskQueue after your app launch
5762``` objc
@@ -184,21 +189,21 @@ Conform STHTTPNetTaskRequestObject protocol
184189@end
185190```
186191
187- #### Work with ReactiveCocoa for getting net task result
188-
192+ #### Use subscription block
189193```objc
190- [STNetTaskObserve( _openWeatherTask) subscribeCompleted:^(
191- if (_openWeatherTask .error) { // Would be network issue
194+ [_openWeatherTask subscribeState:STNetTaskStateFinished usingBlock:^(STNetTask *task) {
195+ if (task .error) { // Would be network issue
192196 _resultLabel.text = @"Network Unavailable";
193197 _goBtn.hidden = YES;
194198 return;
195199 }
200+
196201 _resultLabel.text = [NSString stringWithFormat:@"%@\n%.1f°C", _openWeatherTask.place, _openWeatherTask.temperature];
197202 _goBtn.hidden = YES;
198203}];
199204```
200205
201- #### Or use STNetTaskDelegate
206+ #### Use STNetTaskDelegate
202207
203208``` objc
204209- (void )netTaskDidEnd:(STNetTask *)task
@@ -219,6 +224,21 @@ Conform STHTTPNetTaskRequestObject protocol
219224 _goBtn.hidden = YES;
220225}
221226```
227+
228+ #### Work with ReactiveCocoa for getting net task result
229+
230+ ``` objc
231+ [STNetTaskObserve (_openWeatherTask) subscribeCompleted: ^(
232+ if (_ openWeatherTask.error) { // Would be network issue
233+ _ resultLabel.text = @"Network Unavailable";
234+ _ goBtn.hidden = YES;
235+ return;
236+ }
237+ _ resultLabel.text = [ NSString stringWithFormat:@"%@\n%.1f°C", _ openWeatherTask.place, _ openWeatherTask.temperature] ;
238+ _ goBtn.hidden = YES;
239+ }] ;
240+ ```
241+
222242For more details, download the example project or check out unit tests for usage references.
223243
224244### Set max concurrent tasks count of STNetTaskQueue
0 commit comments