I am working on an iOS app and I have data stored in CoreData that I am loading into a UITableView. The data entities have an attribute called id which is a string
id
For Swift3
key is
result: Bool = 0 < "string1".localizedCompare("string2").rawValue
Use like this
[some string array].sorted { return 0 < "string1".localizedCompare("string2").rawValue }