I'm not sure if I just did not found any information or if it's not possible.
I've looked up several pages. I want to use generic a generic version of the NSOrderedSet in Swift.
With a Set you can do this:
Swift’s Set type is bridged to Foundation’s NSSet class. Source: Apple Docs - Sets
In a NSManagedObject subclass you can simply change the NSSet to Set and it will work. (Tested it)
@property NSArray<NSDate *> *dates;
@property NSSet<NSString *> *words;
@property NSDictionary<NSURL *, NSData *> *cachedData;
var dates: [NSDate]
var words: Set<String>
var cachedData: [NSURL: NSData]
But I couldn't find any reference to an ordered set in Swift. I could use the NSOrderedSet from Objective-C but I won't have generics in Swift then.
Is there any possibility to define an order in a set in Swift?