I am working on a framework that is written in both Obj-C and Swift. Due to this mixing, I have to expose (make public) a lot of internal classes.
Xcode can generate docs for this project without problems (Product -> Build Documentation). But I want to ignore some classes and not add them to the public API reference.
I've found that I can use @_documentation(visibility: ...) in Swift classes to remove them from the doc.
The Objective-C symbol extraction is based on header visibility.
If your Objective-C symbols are defined in public headers for your framework they will be included in the documentation. If you change these headers to a "private" or "project" header visibility they won't be considered for documentation, but they are also no longer public API for your framework.
IIRC there's no per-symbol attribute to exclude a C/C++/Objective-C symbol from documentation but @daniel-grumberg would know more.
Unfortunately I can't change the visibility to "private" or "project" because they are used in the Swift classes of the same SDK and, as a result - should be public. So a lot of internal classes of the library appear in the docs.
@YuriyVelichkoPI you can prepend your Objective-C types with an _ character while keeping them public. This allows Swift interoperability and it won't show up neither in docs or in code completion for the consumers of your framework.
It will still show up in code completion when working on the framework if you type in the _.
Headers that are needed by the SDK but not by clients can be listed as "private" in Xcode—this will emit the headers to a folder called PrivateHeaders inside your framework when you compile it. The other components of your SDK can then access these headers, but they won't be accessible to client-side code without extra effort.
To make symbols in headers in PrivateHeaders visible to Swift, you may need to create a ModuleName.private.modulemap file.
In Apple jargon, symbols listed in headers in PrivateHeaders are "SPI" (System Programming Interfaces), so the equivalent Swift feature is @_spi.