-
Notifications
You must be signed in to change notification settings - Fork 104
Extending Image Manager Guide
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.