-
Notifications
You must be signed in to change notification settings - Fork 8
Coding style
Baluta Cristian edited this page Oct 7, 2016
·
5 revisions
The coding style of this project is basically the default Xcode swift style with some personal preferences. To mention:
- open { on the same line as their methods and vars
- leave a space before opening ( of a method that has parameters
- the first line of a method should be empty if: *the code is long and makes it indistinguishable from the method name; *the method has more than 2-3 lines
- 'else {' should be on a new line, unless the code inside 'if else' has only one line. 'else if' always on a new line. Helps for readability, doesn't matter is not consistent
- use extensions instead MARKs
- leave an empty line between methods
- code should not exceed much the page guideline. Long methods should be split in multiple lines
- use RCLog instead print because is more useful
- do not use 'self' unless you are in a closure and is really necessary