I want the Swift version of this code:
NSArray *sortedNames = [names sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
If your array does not contain Custom Objects (just a string or number type):
var sortedNames = sorted(names, <)
Otherwise if you create a Custom Data Object Class containing custom properties inside:
customDataObjectArray.sort({ $0.customProperty < $1.customProperty })