I am looking at Protocol Oriented Programming with Swift 3.0. I have found that POP offers a great deal of programming flexibility. One area that I have struggled with is the ability to have an implementation (think protocols and extensions on those protocols) where code is spread across more than one file. The issue is around encapsulation.
I want to be free to share details between files that are part of the POP implementation but not expose those details to the outside world. One solution I have looked at is to use Modules. This does work but the level of effort to create and maintain seems high to achieve the access control I am looking for.
Fileprivate was a solution I used to achieve code separation but all code had to be placed in the same file. I attempted to submit a a request in Swift Evolution for a way to have a group access, something like directoryprivate but that set off a barrage of sniper fire that made me an instant casualty. Yes, you can "-1 me" on that experience.
Is there a preferred way to obtain encapsulation across multiple files in Swift without having to resort to creating modules each time?
Thanks in advance,
- Jim