Instance Property


An array of extra protocol subclasses that handle requests in a session.


@property(copy) NSArray<Class> *protocolClasses;


The objects in this array are Class objects corresponding to custom NSURLProtocol subclasses that you define. URL session objects support a number of common networking protocols by default. Use this array to extend the default set of common networking protocols available for use by a session with one or more custom protocols that you define.

Prior to handling a request, the NSURLSession object searches the default protocols first and then checks your custom protocols until it finds one capable of handling the specified request. It uses the protocol whose canInitWithRequest: class method returns YES, indicating that the class is capable of handling the specified request.

The default value is an empty array.

See Also

Supporting Custom Protocols


An abstract class that handles the loading of protocol-specific URL data.