阵列内与最大的对象数组我有CLLocations数组的数组,我试图寻找一种有发生最近根据其时间戳CLLocation对象数组。索引或实际列表都足够了。获取数组
到目前为止,我想出了:
let latestList = listOfListOfLocations.index{$0.max{a,b in a.timestamp < b.timestamp} < $1.max{c,d in c.timestamp < d.timestamp}}
,但我发现没有运气,不能让我的头轮它是相对较新的斯威夫特。任何帮助将不胜感激。
@MartinR谢谢,稍后我会更新 – Alexander
那太好了,谢谢,我怎么也更改为获得指数? – user3599895
@ user3599895哪个索引? – Alexander