Sort array of dictionary

后端 未结 3 828
無奈伤痛
無奈伤痛 2020-12-21 11:25

I need to sort an array of dictionaries in the following ways. The array contains dictionaries with the following format:

[{
  fecha = \"09:54:51\";
  \"nomb         


        
3条回答
  •  失恋的感觉
    2020-12-21 12:32

    You can use the sort method the following way:

    myArray.sort { $0["numero"]! < $1["numero"]! }
    

提交回复
热议问题