Organizing code into extensions

A theme of access control is the idea that your code should be loosely coupled and highly cohesive. Loosely coupled code limits how much one entity knows about another, which in turn makes different parts of your code less dependent on others. Highly cohesive code, as you learned earlier, helps closely related code work together to fulfill a task.

Swift features such as access modifiers, when used with extensions, can help you both organize your code as well as encourage good software design.

results matching ""

    No results matching ""