I'm having trouble declaring a NSMutableArray in Swift 3 because using legacy objective C code bridges the swift Array data type to NSArray. Here's what I'm trying to do:
var myMutableArray: NSMutableArray = [myObjectCustomClass]
But I'm getting a compiling error:
Cannot convert value of type '[myObjectCustomClass].Type' (aka 'Array.Type' to specified type 'NSMutableArray'
I've tried a few other ways as well such as:
var myMutableArray = NSMutableArray<myObjectCustomClass>
var myMutableArray:[myObjectCustomClass] = NSMutableArray<myObjectCustomClass>
but no luck. Any ideas?
var myMutableArray = NSMutableArray()?myObjectCustomClass. How would I add that?NSMutableArraylets you add objects of any type to it. That's why you use swift arrays.