Skip to content

Instantly share code, notes, and snippets.

@collindonnell
Created July 30, 2021 18:10
Show Gist options
  • Save collindonnell/4b0cceb87860ea9ffc0a1a286f411124 to your computer and use it in GitHub Desktop.
Save collindonnell/4b0cceb87860ea9ffc0a1a286f411124 to your computer and use it in GitHub Desktop.
Some general guidelines I came up.

Coding Rules for Swift Apps

  • Keep classes and similar below 100 lines.
  • Keep methods below ten lines, preferably five.
  • Don't check state variables or type to determine behavior over making a type.
  • Make data sources their own type.
  • View controllers should subscribe to no more than two delegate protocols.
  • Make classes manage their own behavior.

These are guidelines only. Break any if your circumstance calls for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment