I am trying to sort the NSMutableArray with this piece of code
let sortContacts = contactData! as NSArray as? [String]
print("\(sortContacts.sort())")
I am trying to convert the NSMutableArray to Array of String but when it comes to print("\(sortContacts.sort())") its giving me nil
Anyone who can suggest me sorting through NSMutableArray?
as NSArrayand just useas? [String]and then just use the Swift array sort method. It needs a closure that performs the comparison for sortingcontactDatais an array of String?NSArrayi think