Friend classes in Swift (access private members of internal class)

Viewed 3515

I have two Swift classes in two different files, both in the same target. Is there a way to give one access to the private members of the other without exposing them as internal or public?

(I'm essentially looking for something analogous to friend in C++.)


Motivation:

This could be useful for something like implementing UIViewControllerAnimatedTransitioning in a separate "transition" class—typically requiring intimate knowledge of the source and destination view controllers—without requiring those view controllers to expose private subviews to the rest of the target.

1 Answers
Related