We've chosen to stand on the shoulders of giants, and follow Google's Swift styleguide and Swift API guidelines, with 2 additional rules:
-
We should try and use whatever language/syntax features the latest stable Swift compiler allows for.
-
Constructors should be as side-effect free as possible to aid with testing. Specifically, we should not do the following in a constructor:
- Heavy I/O
- Starting timers
- Scheduling work
Instead, an object should only start to operate after an explicit start()
invocation.
All code should be formatted with the latest release of swiftformat
. The swiftformat configuration in the
mullvadvpn-app repository is the reference configuration.