Loading...
Loading...
Swift style guidelines covering naming conventions, code organization, and best practices for writing idiomatic Swift code.
npx skill4agent add swiftzilla/skills swift_stylevarletpublicprivateinternalfileprivateopen| Category | Case | Example |
|---|---|---|
| Types & Protocols | UpperCamelCase | |
| Variables, Functions | lowerCamelCase | |
| Boolean Properties | | |
| Constants | lowerCamelCase | |
Need identity or reference semantics?
├── YES → Use Class
└── NO → Need inheritance?
├── YES → Use Class
└── NO → Modeling finite states?
├── YES → Use Enum
└── NO → Use Struct (default)| Modifier | Visibility | Use When |
|---|---|---|
| Enclosing declaration | Strict encapsulation |
| Same file | File-local helpers |
| Same module | Implementation details |
| Everywhere | Public API |
| Everywhere + subclassable | Extensible frameworks |
letvar