Swift Coding Style
This file extends common/coding-style.md with Swift specific content.
This file extends common/coding-style.md with Swift specific content.
--- paths:
---
This file extends [common/coding-style.md](../common/coding-style.md) with Swift specific content.
Follow [Apple API Design Guidelines](https://www.swift.org/documentation/api-design-guidelines/):
Use typed throws (Swift 6+) and pattern matching:
func load(id: String) throws(LoadError) -> Item {
guard let data = try? read(from: path) else {
throw .fileNotFound(id)
}
return try decode(data)
}Enable Swift 6 strict concurrency checking. Prefer: