Skip to content

Instantly share code, notes, and snippets.

@collindonnell
Created July 30, 2021 18:15
Show Gist options
  • Save collindonnell/b02d90b363728747385336c72f5b9d47 to your computer and use it in GitHub Desktop.
Save collindonnell/b02d90b363728747385336c72f5b9d47 to your computer and use it in GitHub Desktop.
General guidelines for Swift apps.

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 (make a new type).
  • Make data sources their own type.
  • View controllers should subscribe to no more than two delegate protocols.
  • 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