Tells the URL session that the session has been invalidated.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The session object that was invalidated.
The error that caused invalidation, or
nil if the invalidation was explicit.
If you invalidate a session by calling its
finishTasksAndInvalidate method, the session waits until after the final task in the session finishes or fails before calling this delegate method. If you call the
invalidateAndCancel method, the session calls this delegate method immediately.
Handling Session Life Cycle Changes