Initializer

init(request:cachedResponse:client:)

Creates a URL protocol instance to handle the request. URLプロトコルインスタンスを作成してリクエストを取り扱います。

Declaration 宣言

init(request: URLRequest, 
cachedResponse: CachedURLResponse?, 
client: URLProtocolClient?)

Parameters パラメータ

request

The URL request for the URL protocol object. This request is retained. URLプロトコルオブジェクトに対するURLリクエスト。このリクエストは保持されます。

cachedResponse

A cached response for the request; it may be nil if there is no existing cached response for the request. リクエストに対するキャッシュされた応答;それはnilかもしれません、もし既存のキャッシャされた応答がそのリクエストにないならば。

client

An object that provides an implementation of the URLProtocolClient protocol that this instance uses to communicate with the URL Loading System. This client object is retained. あるオブジェクト、それはURLProtocolClientプロトコルの実装を提供します、それはこのインスタンスが使用してURLローディングシステムと通信するものです。このクライアントオブジェクトは保持されます。

Return Value 戻り値

The initialized protocol object. 初期化されたプロトコルオブジェクト。

Discussion 議論

Subclasses should override this method to do any custom initialization. Don’t call this method explicitly. When you register your custom protocol class, the system will initialize instances of your protocol as needed. サブクラスは、このメソッドをオーバーライドして、何らかのあつらえの初期化を行うべきです。このメソッドを明示的に呼び出さないでください。あなたがあなたのあつらえのプロトコルクラスを登録する時、システムはあなたのプロトコルのインスタンスを必要に応じて初期化するでしょう。

This is the designated initializer for URLProtocol. これは、URLProtocolに対する指定イニシャラザです。

See Also 参照

Creating Protocol Objects プロトコルオブジェクトを作成する