Spotify's official Objective-C and Objective-C++ coding style guide for iOS development.
Spotify Objective-C Coding Style is a style guide that documents the coding conventions for Objective-C and Objective-C++ code used in Spotify's iOS client. It provides detailed rules on formatting, naming, documentation, and best practices to ensure code consistency and quality across the iOS codebase.
iOS developers at Spotify and Objective-C developers seeking to adopt a well-structured, industry-tested style guide for their projects.
Developers choose this guide because it offers a clear, practical set of rules derived from Spotify's real-world iOS development, promoting readability and maintainability while aligning with Apple's official guidelines.
Guidelines for iOS development in use at Spotify
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Defines precise rules for line length (120 characters), indentation (4 spaces), and container formatting, ensuring clean and consistent code layout across teams.
Recommends using NS_ASSUME_NONNULL_BEGIN/END and explicit nullable annotations, which helps prevent null pointer errors and improves code safety in Objective-C.
Enforces Xcode's documentation style with /// comments and tags like @param and @return, making APIs easier to understand and maintain through IDE integration.
Encourages returning early on errors to reduce nesting, as shown in examples, which enhances code clarity and reduces complexity.
Published in 2015-2016 and not updated, making it less relevant for modern iOS development where Swift is predominant, and it lacks guidance on newer frameworks or Swift-specific practices.
Does not include or reference tools for automatically enforcing the style rules (e.g., clang-format integration), requiring manual adherence that can be error-prone and time-consuming.
Includes rules like prefixing category methods with `spt_`, which are tailored for Spotify's internal codebase and may add unnecessary overhead or confusion for external teams.