ResponseCacher
public struct ResponseCacher
ResponseCacher is a convenience CachedResponseHandler making it easy to cache, not cache, or modify a cached
response.
-
Defines the behavior of the
ResponseCachertype.- cache: Stores the cached response in the cache.
- doNotCache: Prevents the cached response from being stored in the cache.
- modify: Modifies the cached response before storing it in the cache.
Declaration
Swift
public enum Behavior -
Returns a
ResponseCacherwith a followBehavior.Declaration
Swift
public static let cache: ResponseCacher -
Returns a
ResponseCacherwith a do not followBehavior.Declaration
Swift
public static let doNotCache: ResponseCacher
-
Declaration
Swift
public func dataTask(_ task: URLSessionDataTask, willCacheResponse response: CachedURLResponse, completion: @escaping (CachedURLResponse?) -> Void)
View on GitHub
Install in Dash
ResponseCacher Structure Reference