Does it make sense to completely avoid using the keywords "public" and "open" in the main target program?
We have a large iOS 150K + app of code, a quarter of its code is Swift.
I am currently writing a separate module: iOS dynamic infrastructure, where I carefully use the public
, internal
, fileprivate
, private
. This work made me think about the main goal of our application as a large Swift module that could use all its classes at the most internal
level , and the reason for this is that these classes are not accessible from outside our application, but only from the inside.
I don't have time to dive into the internals of Swift and do an experiment to measure performance differences, so I ask if anyone has any insight if:
- this usage practice
public
oropen
for application classes makes sense - if it makes a performance difference like incremental compile time.
Of course, code that connects with Objective-C is outside the scope of this question.
Background: In Objective-C, C, and C ++, putting as much as possible in files .cpp
and forwarding everything in files .h
makes a big difference in terms of incremental compile times, so I'm wondering, practice should be considered for Swift applications.
source to share
No one has answered this question yet
Check out similar questions: