I have an Obj-c superclass, with
@property (strong, nonatomic) NSMutableArray *sectionChanges;
And in Swift I am trying to add a dictionary to it:
self.sectionChanges.addObject([NSFetchedResultsChangeType.Insert: 1])
We get
'AnyObject' does not have a member named 'Key'
I have tried a lot of options:
self.sectionChanges.addObject([NSFetchedResultsChangeType.Insert: 1] as NSDictionary)
Changed the error to
Type 'NSFetchedResultsChangeType' does not conform to protocol 'NSCopying'
Then I try:
self.sectionChanges.addObject([Int(NSFetchedResultsChangeType.Insert): 1] as NSDictionary)
and get:
Cannot invoke 'init' with an argument of type 'NSDictionary'
Running out of options... Then same code in Obj-c is simple:
[self.sectionChanges addObject:@{@(type): @(sectionIndex)}];