How I Structure All My Xcode Projects.


AppName/

├── App/
│ ├── AppEntry.swift
│ └── AppState.swift

├── Features/
│ ├── Home/
│ ├── Settings/
│ ├── Profile/
│ └── Shared/

├── Services/
│ ├── Audio/
│ ├── Network/
│ ├── Storage/
│ └── Notifications/

├── Models/

├── Utilities/

├── Design/
│ ├── Colors.swift
│ ├── Typography.swift
│ └── Components/

├── Resources/
│ ├── Assets.xcassets
│ └── Sounds/

└── Support/
├── InfoPlist-Notes.md
└── DebugHelpers.swift



Features folder = clean separation

Each feature contains:

  • View
  • ViewModel
  • Subcomponents
  • Logic specific to that feature

No giant files. No spaghetti.



Services are abstracted

Every service has:

  • a protocol
  • a live implementation
  • optionally a mock

Makes testing way easier:

protocol AudioServiceProtocol {
    func play(_ file: String)
    func stopAll()
}
Enter fullscreen mode

Exit fullscreen mode

✔ Design system lives in one place
Colors, typography, reusable components, spacing — all centralized.

Your app finally feels consistent.

✔ Resources are not mixed with logic
Sounds, JSON files, images, fonts — all under one folder.

✔ Support folder stores non-shipping dev files
Notes, documentation, experiments, debug helpers.

🧩 Workflow Tips

  1. Use extension files sparingly
    Don’t put every modifier and helper in one huge file.

Instead create:

mathematica
Copy code
Utilities/Date+Format.swift
Utilities/String+Validation.swift
Much cleaner.

  1. Use folders, not groups
    Fewer path issues when collaborating or using build scripts.

  2. Keep feature folders self-contained
    A feature should be easy to move, rename, or delete.

If a feature can’t stand alone → it’s not modular enough.

🚀 Final Thoughts
This structure helps me:

scale apps faster

onboard contributors easily

debug without hunting files

avoid “junk drawer” folders



Source link