Problem Statement
Explain Swift's access control levels (`open`, `public`, `internal`, `fileprivate`, `private`) and when you would use each in your codebase.
Explanation
Swift offers five main access levels: `open`, `public`, `internal`, `fileprivate` and `private`. /n/n `open` allows subclassing and use outside the module; `public` allows use outside but not subclassing; `internal` (the default) allows use within the module; `fileprivate` restricts use to the same file; `private` restricts use to the enclosing declaration. /n/n You choose levels based on encapsulation: use `private` for internal implementation, `fileprivate` for multi-type cooperation in one file, `internal` for typical app-module use, `public`/`open` when building frameworks. Clear access control helps maintain modularity and hides implementation details from consumers.