One Logo Pool Ball
Foundation · IOS API REFERENCE

URLProtocol

class · iOS 2.0+ · SDK 27.1

class URLProtocol

Members (17)

static · iOS 2.0+

canInit

TypeScript
static canInitWith(request: URLRequest): boolean
Swift declaration
class func canInit(with request: URLRequest) -> Bool
static · iOS 8.0+

canInit

TypeScript
static canInitWith33811(task: URLSessionTask): boolean
Swift declaration
class func canInit(with task: URLSessionTask) -> Bool
static · iOS 2.0+

canonicalRequest

TypeScript
static canonicalRequest(request: URLRequest): URLRequest
Swift declaration
class func canonicalRequest(for request: URLRequest) -> URLRequest
static · iOS 2.0+

property

TypeScript
static property(key: string, request: URLRequest): (unknown) | null
Swift declaration
class func property(forKey key: String, in request: URLRequest) -> Any?
static · iOS 2.0+

registerClass

TypeScript
static registerClass(protocolClass: string): boolean
Swift declaration
class func registerClass(_ protocolClass: AnyClass) -> Bool
static · iOS 2.0+

removeProperty

TypeScript
static removeProperty(key: string, request: NSMutableURLRequest): void
Swift declaration
class func removeProperty(forKey key: String, in request: NSMutableURLRequest)
static · iOS 2.0+

requestIsCacheEquivalent

TypeScript
static requestIsCacheEquivalent(a: URLRequest, b: URLRequest): boolean
Swift declaration
class func requestIsCacheEquivalent(_ a: URLRequest, to b: URLRequest) -> Bool
static · iOS 2.0+

setProperty

TypeScript
static setProperty(value: unknown, key: string, request: NSMutableURLRequest): void
Swift declaration
class func setProperty(_ value: Any, forKey key: String, in request: NSMutableURLRequest)
static · iOS 2.0+

unregisterClass

TypeScript
static unregisterClass(protocolClass: string): void
Swift declaration
class func unregisterClass(_ protocolClass: AnyClass)
init · iOS 2.0+

init

TypeScript
static initRequestCachedResponseClient(request: URLRequest, cachedResponse?: (CachedURLResponse) | null, client?: (Implements<URLProtocolClient> | SDKHandle) | null): URLProtocol
Swift declaration
init(request: URLRequest, cachedResponse: CachedURLResponse?, client: (any URLProtocolClient)?)
init · iOS 8.0+

init

TypeScript
static initTaskCachedResponseClient(task: URLSessionTask, cachedResponse?: (CachedURLResponse) | null, client?: (Implements<URLProtocolClient> | SDKHandle) | null): URLProtocol
Swift declaration
convenience init(task: URLSessionTask, cachedResponse: CachedURLResponse?, client: (any URLProtocolClient)?)
method · iOS 2.0+

startLoading

TypeScript
startLoading(): void
Swift declaration
func startLoading()
method · iOS 2.0+

stopLoading

TypeScript
stopLoading(): void
Swift declaration
func stopLoading()
get · iOS 2.0+

cachedResponse

TypeScript
get cachedResponse(): (CachedURLResponse) | null
Swift declaration
@NSCopying var cachedResponse: CachedURLResponse? { get }
get · iOS 2.0+

client

TypeScript
get client(): (SDKHandle) | null
Swift declaration
var client: (any URLProtocolClient)? { get }
get · iOS 2.0+

request

TypeScript
get request(): URLRequest
Swift declaration
var request: URLRequest { get }
get · iOS 8.0+

task

TypeScript
get task(): (URLSessionTask) | null
Swift declaration
@NSCopying var task: URLSessionTask? { get }

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

URLProtocol.init()

inherited init: cannot prove legal (class declares 2 custom initializers)

All Foundation types →