I have a few apps that I am trying to develop a reusable URL connection layer. I have done some research and am struggling between architectures. Specifically the APIs this layer utilizes.
In the past, I have used NSURLConnection
and NSOperation
on a separate RunLoop. This seems overkill. I've seen libraries that subclass NSURLConnection
. Others have a singleton Engine object that manages all requests.
The Engine and/or NSURLConnection
seem best to me. But I am asking for input before I go too far down one road. My goals would be:
- Ability to cancel a request
- Concurrent requests
- Non-blocking
- Data object of current open requests
Any direction or existing references with code samples would be greatly appreciated.