LinkedIn's official style guide for writing consistent and maintainable Swift code.
LinkedIn's Swift Style Guide is an official set of conventions and best practices for writing Swift code. It provides detailed rules for code formatting, naming, and coding style to ensure consistency, readability, and maintainability across Swift projects. The guide complements Apple's API Design Guidelines by offering LinkedIn's specific recommendations.
Swift developers and engineering teams, particularly those working on large-scale or collaborative projects where code consistency is critical. It is especially relevant for teams adopting or enforcing a unified Swift style within an organization.
Developers choose this guide for its comprehensive, real-world-tested rules that promote clarity and safety, directly reflecting LinkedIn's engineering standards. It offers specific, actionable guidelines beyond Apple's basics, helping teams avoid common pitfalls and enforce a consistent codebase.
LinkedIn's Official Swift Style Guide
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides detailed, actionable rules for indentation, line length (max 160 chars), and brace placement, with code snippets showing multi-line function declarations and array formatting for consistency.
Enforces PascalCase for types and camelCase for properties, with specific examples like avoiding prefixes and using full acronyms (e.g., URLFinder), reducing ambiguity in large codebases.
Includes LinkedIn-tested guidelines for Swift features like preferring let over var, using guard for early returns, and avoiding force unwraps, promoting safety and readability.
Offers specific instructions for Swift's markup syntax in doc comments, such as using - parameter labels and block comments, enhancing code maintainability.
Last updated for Swift 4.0 in 2018, so it misses newer language features (e.g., Swift 5's Result type or SwiftUI) and may recommend obsolete practices, as admitted in the README's version note.
Lacks built-in tooling or integration with linters like SwiftLint, requiring manual adherence and code reviews, which can be error-prone and time-consuming for teams.
Rules like never using unowned or avoiding shorthand for class methods (e.g., .white) may be too restrictive for projects needing flexibility or performance optimizations beyond LinkedIn's scope.