finish(error:)
Finishes the writer.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
func finish(error: Error)
Parameters
- error
The error indicating why the writer finished.
Calling this function signals the writer that any suspended calls to yield(contentsOf:)
or yield(_:)
will be resumed. Any subsequent calls to yield(contentsOf:)
or yield(_:)
will throw.
Any element that have been yielded before the writer has been finished which have not been delivered yet are continued to be buffered and will be delivered once the writer becomes writable again.