Restricted access to protocol conformance?

I think all of us could found situations when the protocol conformance was necessary but the required fields or functions had no value outside of the particular framework or operating type. Even more, these added methods could be prohibited from being used, like in numerous cases of implementing UIKit protocols or subclassing base UIKit classes.
In SwiftUI we also have body property that is not designed to be called outside of the framework itself.
Maybe, we should try to solve this problem by adding protocol conformances "just for internal usage" in some module or even a type.
Something like
private(UIKit) func viewDidload() or private(SwiftUI) var body....

1 Like