[swift-evolution] Type-based ‘private’ access within a file
bjhomer at gmail.com
Fri Apr 7 10:32:54 CDT 2017
> On Apr 7, 2017, at 9:23 AM, Matthew Johnson <matthew at anandabits.com> wrote:
> The most common thing is to have some stored properties that are private and include a handful of fileprivate (or higher) methods that operate on these properties in the type declaration. All members that don’t need direct access to these properties are placed in extensions specifically to prevent the direct access to stored properties which they don’t need. This minimizes the lines of code with access to such properties.
Is there a reason this could not be implemented by putting all the sensitive stored properties in a separate type from the rest of the code?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution