swift 字典排序
方法一
letresult = dic.sorted{$0.0< $1.0}
print(result)//打印结果:[("1", "a"), ("2", "b"), ("3", "c")]
方法二
letarray1 = dic.keys.sorted(by: >)
swift 字典排序
方法一
letresult = dic.sorted{$0.0< $1.0}
print(result)//打印结果:[("1", "a"), ("2", "b"), ("3", "c")]
方法二
letarray1 = dic.keys.sorted(by: >)
本文标题:swift 字典排序
本文链接:https://www.haomeiwen.com/subject/iigsoqtx.html
网友评论