A protocol that defines methods that URL session instances call on their delegates to handle task-level events specific to stream tasks.
SDKs
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
protocol URLSessionStreamDelegate
Overview
In addition to these methods, be sure to implement the methods in the URLSession
and URLSession
protocols to handle events common to all task types and session-level events, respectively.
Note
A URLSession
object need not have a delegate. If no delegate is assigned, a system-provided delegate is used, and you must provide a completion callback to obtain the data.