Make sure to read Apple's API Design Guidelines.
We use SwiftFormat to enforce a basic swift format style.
CI will fail if it finds any format issue.
You can run SwiftFormat
locally with make lint
to get warnings, or make swiftformat
to implement the changes automatically.
- Always UPPERCASED when it's part of a Type name.
- Use lowercase everytime it's a prefix, and is not a type name.
- Use lowercase if it's writen alone, and it's not a type name.
For example:
struct URLType {
let url: URL
let someURL: URL
init(_ url: URL)
func api(with userID: String) -> API
func api(id: ID) -> API
}
let urlSomething = URLType(url)
let someURL = URLType(someURL)