Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Extending Image Manager Guide

Alexander Grebenyuk edited this page Jan 23, 2015 · 8 revisions

Adding support for custom URL protocol

The DFURLImageFetcher class is built using Foundation URL Loading System. The URL loading system natively supports the http, https, file, ftp, and data protocols. It also allows clients to extend the number of the supported protocols and to provide their own implementation of natively supported protocols. This functionality is often used by libraries like OHHTTPStubs that are designed to stub network requests for your unit tests.

There are many existing tutorials on the web on how to implement and register your custom URL protocol (subclass of abstract NSURLProtocol class). There are no other steps required to make those protocols available in DFURLImageFetcher. However if you are using a DFCompositeImageManager you should also make sure that the URL scheme supported by your custom protocol is added to the supportedSchemes set of the DFURLImageFetcher. The set is used when DFURLImageFetcher determines whether is can handle image request (DFImageRequest) or not.

Clone this wiki locally