Quantcast
Channel: Sorting in swift 3.0 - Stack Overflow
Browsing all 3 articles
Browse latest View live

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 Article



Answer 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 Article

Sorting 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
Browsing all 3 articles
Browse latest View live




Latest Images