我想知道是否有任何方法可以防止核心数据从核心数据模型实体生成公共类。
目前它生成这样的类:
import Foundation
import CoreData
public class MyEntityMO: NSManagedObject {
}
extension MyEntityMO {
@nonobjc public class func fetchRequest() -> NSFetchRequest<RecordSettingMO> {
return NSFetchRequest<RecordSettingMO>(entityName: "RecordSettingMO")
}
@NSManaged public var someBoolean: Bool
}
但我希望它是这样的(使用内部访问修饰符):
import Foundation
import CoreData
internal class MyEntityMO: NSManagedObject {
}
extension MyEntityMO {
@nonobjc internal class func fetchRequest() -> NSFetchRequest<RecordSettingMO> {
return NSFetchRequest<RecordSettingMO>(entityName: "RecordSettingMO")
}
@NSManaged internal var someBoolean: Bool
}