Instance Property

protocolClasses

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

Declaration

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

Discussion

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

NSURLProtocol

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software