Instance Method


Returns all of the cookie storage’s cookies, sorted according to a given set of sort descriptors.


func sortedCookies(using sortOrder: [NSSortDescriptor]) -> [HTTPCookie]



The sort descriptors to use for sorting, as an array of NSSortDescriptor objects.

Return Value

The cookie storage’s cookies, sorted according to sortOrder, as an array of HTTPCookie objects.

See Also

Retrieving Cookies

var cookies: [HTTPCookie]?

The cookie storage’s cookies.

func getCookiesFor(URLSessionTask, completionHandler: ([HTTPCookie]?) -> Void)

Fetches cookies relevant to the specified task and passes them to the completion handler.

func cookies(for: URL) -> [HTTPCookie]?

Returns all the cookie storage’s cookies that are sent to a specified URL.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software