I'm having trouble making a Swift NSManagedObject subclass conform to an Objective-C protocol.
I've created a model protocol in order to abstract somewhat my Core Data models from other components in my app which have no business knowing these things are Core Data Managed Objects...
So I have a protocol as follows:
@protocol UserProtocol <NSObject>
@property (nonatomic) NSSet *friends;
@end
And my managed object subclass in swift is:
class User: NSManagedObject, UserProtocol {
@NSManaged var friends: Set<User>
}
Unfortunately I am being told User does not conform to UserProtocol. I can't find a way to see the swift interpretation of my Objective-C protocol, is there a way to do that? If I can see that I could work out why my swift class isn't matching the protocol.

var Setnot equivalent toNSMutableSet?@NSManagedrequiresvar. You've got a point though maybe Set resolves to NSMutableSet. So isn't there a way to get a Swift view on an Objective-C piece of code?NSSetis mapped toSet<NSObject>, so you would have to define the property as@NSManaged var friends: Set<NSObject>to satisfy the protocol.