[swift-users] file io in Swift 2.2 for Linux (would like to be pointed in the right direction)
jens at mooseyard.com
Sun Jun 5 17:55:51 CDT 2016
Looks good, but you'll want some error handling. There's no clean way to integrate it with Generator because the protocol doesn't allow the implementation to throw, unfortunately. (I've run into the same problem building a Generator around a database query.) I think the best solution is to add a property that returns the NSStream.streamError, or a checkError() method that throws the current error if any, and have the caller use those at the end of the iteration.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users