2

I am trying to implement Batch requests in iOS where several API calls are aggregated into a single HTTP request . As there is a requirement where I have to make a multiple requests and wait till all of them are done and then proceed, I checked and found that Google has ClassRoom API which supports the batch requests. Is there a way it can be achieved in iOS. I am thinking of implementing it using Operation Queues and URLSession. Is this the right approach? Or do suggest on what can be done to achieve.

u09cs47
  • 21
  • 3
  • 1
    You should have a look at using [RxSwift](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/Why.md). They have something to handle aggregating network requests, seems to fit your issue perfectly. If you want to do this without a library you should check out [this on SO](https://stackoverflow.com/questions/46863325/swift-4-async-call-with-for-loop-execute-in-order-using-dispatchgroup-dispatchq) – HJDavies Oct 08 '19 at 11:34

0 Answers0