I am new to swift.I am trying one sample app in which I need to implement the sorting of an array in alphabetical order.I getting the json data and I am adding the titles in
Swift4
var names = [ "Alpha", "alpha", "bravo", "beta"] var sortedNames = names.sorted { $0.localizedCaseInsensitiveCompare($1) == ComparisonResult.orderedAscending } print(sortedNames) //Logs ["Alpha", "alpha","beta", "bravo"]