Answer by Martin R for Sorting in swift 3.0
You have an array of dictionaries of the form [String: String]and a dictionary does not have a name property, so$0.name is invalid (in any Swift version).Retrieving the dictionary value is done via...
View ArticleAnswer by Ahmad F for Sorting in swift 3.0
Actually, I'm not pretty sure if arr.sort{$0.name < $1.name} worked in "older swift", however, it should be like:var arr:Array<Dictionary<String, String>> = [["title":"Mr","name":"XYZ"],...
View ArticleSorting in swift 3.0
var arr:Array<Dictionary<String, String>> = [["title":"Mrs","name":"Abc"],["title":"Mr","name":"XYZ"]]arr.sort { (<#[String : String]#>, <#[String : String]#>) -> Bool...
View Article
More Pages to Explore .....