General rules
- Use Swift.
IBOutlets
andIBActions
are in defined in the top of a view controller.- Use extensions when implement protocol methods to group related code.
Linter
- We use swiftlint tool for linting on every development build and for CI builds.
- Adhere to all rules by default. Rules can be disabled or tweaked if all team members agree. Our
.swiflint.yml
config:
excluded:
- Pods
- fastlane
disabled_rules:
- opening_brace # When method definition is more than two lines long opening brace is on new line
line_length: 125
variable_name:
excluded: # add following names to be excluded from variable length rule
- id
type_name:
max_length:
warning: 50 # Test double class names tend to be long
reporter: checkstyle