One Logo Pool Ball
Foundation · IOS API REFERENCE

URLCache

class · iOS 2.0+ · SDK 27.1

class URLCache

Members (18)

get · iOS 2.0+

shared

TypeScript
static get shared(): URLCache
Swift declaration
class var shared: URLCache { get set }
set · iOS 2.0+

shared

TypeScript
static set shared(value: URLCache)
Swift declaration
class var shared: URLCache { get set }
method · iOS 2.0+

cachedResponse

TypeScript
cachedResponse(request: URLRequest): (CachedURLResponse) | null
Swift declaration
func cachedResponse(for request: URLRequest) -> CachedURLResponse?
method · iOS 8.0+

getCachedResponse

TypeScript
getCachedResponse(dataTask: URLSessionDataTask, completionHandler: ((arg0: (CachedURLResponse) | null) => void)): void
Swift declaration
func cachedResponse(for dataTask: URLSessionDataTask) async -> CachedURLResponse?
init · iOS 2.0+ · Deprecated in iOS 100000.0

init

TypeScript
static initMemoryCapacityDiskCapacityDiskPath(memoryCapacity: number, diskCapacity: number, path?: (string) | null): URLCache
Swift declaration
init(memoryCapacity: Int, diskCapacity: Int, diskPath path: String?)
method · iOS 2.0+

removeAllCachedResponses

TypeScript
removeAllCachedResponses(): void
Swift declaration
func removeAllCachedResponses()
method · iOS 8.0+

removeCachedResponse

TypeScript
removeCachedResponseFor(dataTask: URLSessionDataTask): void
Swift declaration
func removeCachedResponse(for dataTask: URLSessionDataTask)
method · iOS 2.0+

removeCachedResponse

TypeScript
removeCachedResponseFor37233(request: URLRequest): void
Swift declaration
func removeCachedResponse(for request: URLRequest)
method · iOS 8.0+

removeCachedResponses

TypeScript
removeCachedResponses(date: globalThis.Date): void
Swift declaration
func removeCachedResponses(since date: Date)
method · iOS 8.0+

storeCachedResponse

TypeScript
storeCachedResponseFor(cachedResponse: CachedURLResponse, dataTask: URLSessionDataTask): void
Swift declaration
func storeCachedResponse(_ cachedResponse: CachedURLResponse, for dataTask: URLSessionDataTask)
method · iOS 2.0+

storeCachedResponse

TypeScript
storeCachedResponseFor2692(cachedResponse: CachedURLResponse, request: URLRequest): void
Swift declaration
func storeCachedResponse(_ cachedResponse: CachedURLResponse, for request: URLRequest)
get · iOS 2.0+

currentDiskUsage

TypeScript
get currentDiskUsage(): number
Swift declaration
var currentDiskUsage: Int { get }
get · iOS 2.0+

currentMemoryUsage

TypeScript
get currentMemoryUsage(): number
Swift declaration
var currentMemoryUsage: Int { get }
get · iOS 2.0+

diskCapacity

TypeScript
get diskCapacity(): number
Swift declaration
var diskCapacity: Int { get set }
set · iOS 2.0+

diskCapacity

TypeScript
set diskCapacity(value: number)
Swift declaration
var diskCapacity: Int { get set }
get · iOS 2.0+

memoryCapacity

TypeScript
get memoryCapacity(): number
Swift declaration
var memoryCapacity: Int { get set }
set · iOS 2.0+

memoryCapacity

TypeScript
set memoryCapacity(value: number)
Swift declaration
var memoryCapacity: Int { get set }
init · iOS 13.0+

init

TypeScript
static initMemoryCapacityDiskCapacityDirectory(memoryCapacity: number, diskCapacity: number, directory?: (string) | null): URLCache
Swift declaration
convenience init(memoryCapacity: Int, diskCapacity: Int, directory: URL? = nil)

Creates a URL cache object with the specified memory and disk capacities, in the specified directory. A disk cache measured in the tens of megabytes is acceptable in most cases. - Parameters: - memoryCapacity: The memory capacity of the cache, in bytes. - diskCapacity: The disk capacity of the cache, in bytes. - directory: The path to an on-disk directory, where the system stores the on-disk cache. If `nil`, the cache uses a default directory.

Skipped declarations

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

URLCache.init()

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

All Foundation types →