Found two coding styles for Swift:
- github style guide for Swift: https://github.com/github/swift-style-guide
- raywenderlich style guide for Swift: https://github.com/raywenderlich/swift-style-guide
1. In github style, it suggests that let should be used over var binding whenever possible. This is to explicitly show the intent that a value is supposed to or not supposed to change.
2. In raywenderlich style, when declaring protocol conformance, use separate extension instead of declaring all together. Also, do not forget to add // MARK comments.
3. In raywenderlich style, when unwrapping the optional, shadow the original name instead of using a new name.
4. In github style, prefer implicit getters on read-only properties.
5. In github style guide, it is mentioned to prefer structs over classes. Since I am still quite new to Swift, I will need to learn a bit more to really understand it.