I read the Apple's reference about access modifiers in Swift 3. I read also about the same on stackoverflow but I didn't get an answer as the person who asked. As I understood correctly, there are four levels:
I created the schemes for myself to understand a difference between all these modifiers and uploaded here. As you can see, there are no differences between Public and Internal modifiers.. However they're on different levels. Any idea would be appreciated!
Your diagram is just incorrect.
Public members of A.swift
and B.swift
are available to C.swift
and D.swift
. The only restriction is that classes can't be subclassed (they would need to be open
.