Skip to content

Comment on Access Control in Swiftparent

Comments

"internal" offers access to all in the module, not just subclasses.

"protected" would allow you to modify a member of a class when you inherit from it, whether it is in the same module or not.

using "internal" or "public" with a comment saying "please only use this when you subclass" the class is not as neat and tidy.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.