var lines: AsyncLineSequence<URL.AsyncBytes>
The URL’s resource data, as an asynchronous sequence of lines of text.
struct URL.AsyncBytes
An asynchronous sequence of bytes loaded from the URL.
Availability 有効性
Technology
var resourceBytes: URL
.AsyncBytes
{ get }
Use this property with Swift’s for
-await
-in
syntax, to read the contents of a URL byte-by-byte, like this:
To wait for the entire resource to load, use the URLSession
method data(from:
with the await
keyword. URLSession
also offers methods to upload data to a URL endpoint and download a URL’s contents to a file.
var lines: AsyncLineSequence<URL.AsyncBytes>
struct URL.AsyncBytes