Swift Best Practices

Installation
SKILL.md

Swift Best Practices

Priority: P0

Implementation Guidelines

Control Flow

  • Guard for Early Exit: Use guard over nested if for better readability.
  • for-where: Use for item in items where condition instead of nested if.
  • Switch Exhaustiveness: Always handle all cases; use @unknown default for enums.

Value Types & Immutability

  • Prefer Structs: Use struct by default; classes only for reference semantics or inheritance.
  • Immutability: Use let over var whenever possible.
  • Copy-on-Write: Leverage Swift's built-in COW for collections.

Naming & Style

Related skills
Installs
GitHub Stars
488
First Seen