Skip to content

Changing API fundamentally to adopt Swift 5 improvements

Compare
Choose a tag to compare
@amosavian amosavian released this 28 Apr 20:51
e52efbb

This version changes AMSMB2's public API to exploit new Swift features, while providing an Objective-C compatibility layer.

  • Return Result in completion handler instead of nullable pairs
    • You can use switch to handle result or error, see readme
  • Accepting DataProtocol instead of concrete Data
    • You can pass [UInt8] or DispatchData to write(data:) method without casting
  • Accepting Range instead of offset-length pair
    • Use the same range you already use to subscript data for contents(atPath:range:) method
  • Disconnect gracefully
    • disconnect(graceful: true) will wait until all queued file operations are done and their completion handler is executed.
  • Reading from / writing to InputStream/OutputStream directly.
  • Fixed reporting incorrect creation date of file