Why does a class become public if you inherit from NSObject in Swift?

I'm working on a framework.

The library is written in Swift and I notice that when a class inherits from NSObject or conforms to NSObjectProtocol, its declaration can be found in *.framework/Headers/*-Swift.h.

This class is available outside of the module in Objective-C code, so it became public.

Why does it happen if the access level is internal?

#objective-c #swift

5 Likes1.55 GEEK