Airbnb Swift Style Guide

Goals

Following this style guide should:

Note that brevity is not a primary goal. Code should be made more concise only if other good code qualities (such as readability, simplicity, and clarity) remain equal or are improved.

Guiding Tenets

Table of Contents

  1. Xcode Formatting
  2. Naming
  3. Style
    1. Functions
    2. Closures
    3. Operators
  4. Patterns
  5. File Organization
  6. Objective-C Interoperability
  7. Testing
  8. Contributors
  9. Amendments

Xcode Formatting

You can enable the following settings in Xcode by running this script, e.g. as part of a “Run Script” build phase.

⬆ back to top

Naming

⬆ back to top

Style

Functions

Closures

Operators

⬆ back to top

Patterns

⬆ back to top

File Organization

⬆ back to top

Objective-C Interoperability

⬆ back to top

Testing

⬆ back to top

Contributors

⬆ back to top