Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,38 +138,38 @@ _You can enable the following settings in Xcode by running [this script](resourc

* <a id='bool-names'></a>(<a href='#bool-names'>link</a>) **Name booleans like `isSpaceship`, `hasSpacesuit`, etc.** This makes it clear that they are booleans and not other types.

* <a id='capitalize-acronyms'></a>(<a href='#capitalize-acronyms'>link</a>) **Acronyms in names (e.g. `URL`) should be all-caps except when it’s the start of a name that would otherwise be lowerCamelCase, in which case it should be uniformly lower-cased.**
* <a id='camel-case-acronyms'></a>(<a href='camel-case-acronyms'>link</a>) **Acronyms in names (e.g. `URL`) should follow the standard rules of CamelCase.**

<details>

```swift
// WRONG
class UrlValidator {
class URLValidator {

func isValidUrl(_ URL: URL) -> Bool {
func isValidURL(_ URL: URL) -> Bool {
// ...
}

func isUrlReachable(_ URL: URL) -> Bool {
func isURLReachable(_ URL: URL) -> Bool {
// ...
}
}

let URLValidator = UrlValidator().isValidUrl(/* some URL */)
let URLValidator = URLValidator().isValidURL(/* some URL */)

// RIGHT
class URLValidator {
class UrlValidator {

func isValidURL(_ url: URL) -> Bool {
func isValidUrl(_ url: url) -> Bool {
// ...
}

func isURLReachable(_ url: URL) -> Bool {
func isUrlReachable(_ url: url) -> Bool {
// ...
}
}

let urlValidator = URLValidator().isValidURL(/* some URL */)
let urlValidator = UrlValidator().isValidUrl(/* some URL */)
```

</details>
Expand Down