Closed thejeff77 closed 4 years ago
The only syntax issue in your code is the write function, it should be:
try file.write("{\"hello\": \"world\"}")
Omitting Argument Labels: https://docs.swift.org/swift-book/LanguageGuide/Functions.html#ID526
Yeah, that particular code sample from the README hadn't been updated for Files' new API, which was introduced in 4.0. Fixed here: https://github.com/JohnSundell/Files/commit/635e51be758a25e6f956ba57edb5a9eff14be076.
A lot of the below code from the docs is causing me issue:
That first line gives:
Incorrect argument label in call (have 'path:', expected 'storage:')
As the init(path:) is in the parent protocol extension, I'm not sure quite how this works. This project is making me see there is a lot I don't know about swift.
Any help or input is appreciated.