混合框架的自动生成 header 中存在内部 class

Internal class is present in auto generated header of mixed framework

根据有关内部访问修饰符的 Apple 文档:

 For framework targets, only declarations with the public or open 
 modifier appear in the generated header. 

现在我正在编写一个具有 objective C 和 Swift 的混合框架。在其中我定义了一个 swift class :

import Foundation

@objc(Utility)

internal class Utility:NSObject{

   internal func getMyName() -> String
   {
      return "Got the name!"
   }

}

但我仍然能够在框架的 auto-generated header 中看到它:

SWIFT_CLASS_NAMED("Utility")
@interface Utility : NSObject
- (NSString * _Nonnull)getMyName;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

这是在 Xcode 8.2.1 上,知道为什么它不按照文档声明运行。

我参考了这个 post https://whosebug.com/a/37324966/1242077,并标记了 "Allow app extension API only" 的检查,因为它甚至列出了自动生成的内部 class 和方法 header。

我使用这个解决方案来保持 Class 私有:https://whosebug.com/a/33159964/1242077