Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
Add rule about access control
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasLinhart committed May 6, 2015
1 parent 039690c commit 8d5b7f4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.markdown
Expand Up @@ -523,6 +523,17 @@ let swift = "not a scripting language";

**NOTE**: Swift is very different to JavaScript, where omitting semicolons is [generally considered unsafe](http://stackoverflow.com/questions/444080/do-you-recommend-using-semicolons-after-every-statement-in-javascript)

## Access Control

Always use `private` for properties and methods unless they need to be accessed from other places. In case it is accessed from Objective-C use `dynamic`.

**Example:**
```swift
private var timer: NSTimer?
private (set) var type: EventActionType?
private dynamic func timerTriggered(sender: NSTimer)
```

## Language

Use US English spelling to match Apple's API.
Expand Down

0 comments on commit 8d5b7f4

Please sign in to comment.