Sends the contents of a URL to a peer.
- iOS 7.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 10.0+
A file or HTTP URL.
A name for the resource.
The peer that should receive this resource.
A block that gets called when delivery succeeds or fails. Upon success, the handler is called with an error value of
nil. Upon failure, the handle is called with an error object that indicates what went wrong.
NSProgress object that can be used to query the status of the transfer or cancel the transfer.
This method is asynchronous (nonblocking).
On the local device, the completion handler block is called when delivery succeeds or when an error occurs.
On the recipient device, the session calls its delegate’s
session(_: method as soon as it begins receiving the resource. This method provides an
NSProgress object that your app can use to cancel the transfer or check its status.
Upon successful delivery, on the recipient device, the session calls its delegate’s
session(_: method. The received resource is written to a file in a temporary location with the same base name; the app is responsible for opening the file or moving it to a permanent location before that delegate method returns.