dstnbrkr/VCRURLConnection — pull request #25 by glentregoning (2014-11-12 07:27:28+00:00)
Title: NSURLSession support broken on iOS8+

While testing out VCRURLConnection on iOS8+ found nothing was being recorded.

It appears that -[NSURLSessionConfiguration protocolClasses] now behaves differently than it did on earlier iOS versions (supported by https://github.com/AliSoftware/OHHTTPStubs/issues/65 ), now returning internal protocol classes. As a result adding VCR's classes at the end of the list will mean they never get used (presumably the official HTTP / HTTPS protocol classes are used instead).

The patch below inserts the VCR*URLProtocol's at the front of any previous list to avoid this problem. This should be backwards compatible to earlier versions there this list was originally empty.