Nikita P Nikita P - 3 months ago 15
Swift Question

Difference between internal and moduleprivate in Swift

I am not able to understand what is the difference between these two keywords in swift3?

If anyone has a link to a good article about this, please share.

Answer

There is no difference conceptually; moduleprivate was just a possible alternate name for the same access level that didn't get accepted during discussions about access control modifier naming.

https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160328/013854.html

The internal modifier is the only one of the two that actually exists in the Swift language, but the two names represent the same behavior.

Comments