Reputation: 143
When i migrated the code from swift 2.3 to 3.0, its throwing an error as below:
let dictionary = (self.testArray!.object(at: i) as AnyObject).mutableCopy()
How to resolve this issue.
Upvotes: 0
Views: 734
Reputation: 285069
Do not use mutableCopy
in Swift. The var
keyword makes objects mutable
var dictionary = self.testArray![i] as! [String:Any]
And don't use Foundation collection types (NSArray
/ NSDictionary
) in Swift either.
Use native types.
Upvotes: 3