Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

ResponseCacher

mattt edited this page Sep 18, 2020 · 2 revisions

ResponseCacher

ResponseCacher is a convenience CachedResponseHandler making it easy to cache, not cache, or modify a cached response.

public struct ResponseCacher

Inheritance

CachedResponseHandler

Initializers

init(behavior:​)

Creates a ResponseCacher instance from the Behavior.

public init(behavior:​ Behavior)

Parameters

  • behavior:​ The Behavior.

Properties

cache

Returns a ResponseCacher with a follow Behavior.

let cache

doNotCache

Returns a ResponseCacher with a do not follow Behavior.

let doNotCache

behavior

The Behavior of the ResponseCacher.

let behavior:​ Behavior

Methods

dataTask(_:​willCacheResponse:​completion:​)

public func dataTask(_ task:​ URLSessionDataTask, willCacheResponse response:​ CachedURLResponse, completion:@escaping (CachedURLResponse?) -> Void)
Types
Protocols
Global Typealiases
Clone this wiki locally