Confusion about class

In the checklists project, why do we need to declare a new class in a new file? For example the ChecklistItem class in the ChecklistItem.swift file. Can’t we declare it in the viewController?

Hi @feanor, I think overall it makes for better organization and design with the project. It’s not necessarily a solid rule to create new files (especially if they have little code in them), but it will certainly help to have those separate files if you decided to expand, maintain, and navigate your project.

Best,
Gina

good, that makes sense!

This topic was automatically closed after 166 days. New replies are no longer allowed.