I’m making an attempt to subclass NSURLProtocol in Kotlin and that is my implementation.
class NoobProtocol(
request: NSURLRequest,
cachedResponse: NSCachedURLResponse?,
shopper: NSURLProtocolClientProtocol?
) : NSURLProtocol(request, cachedResponse, shopper), NSURLSessionDataDelegateProtocol {
companion object : NSURLProtocolMeta() {
override enjoyable canInitWithRequest(request: NSURLRequest): Boolean requestURL.startsWith("https")) &&
NSURLProtocol.propertyForKey(Constants.PROTOCOL_KEY, request) == null)
override enjoyable canonicalRequestForRequest(request: NSURLRequest): NSURLRequest {
return request
}
}
//different implementation
}
However when I’m registering the protocol I get the error
initWithRequest:cachedResponse:shopper: is just not carried out
Is there something that I’m lacking right here?