Contents

delegate

The delegate assigned when this object was created.

Declaration

var delegate: (any URLSessionDelegate)? { get }

Discussion

This delegate object is responsible for handling authentication challenges, for making caching decisions, and for handling other session-related events. The session object keeps a strong reference to this delegate until your app exits or explicitly invalidates the session. If you do not invalidate the session, your app leaks memory until it exits.

See Also

Working with a delegate