Which access level does a nested type have by default if not specified?

iOS interview question for Intermediate practice.

Answer

internal

Explanation

By default, nested types have internal access control. This means they are accessible within the same module. private would restrict access to the enclosing type only, fileprivate to the same file, and public would make it accessible from anywhere.

Related Questions