var transactionsGroupedByDate = [(String,Array<MyCushyRecords>)]()
i nur geänderte Array von MyCushyRecords Klasse [Int] Index von Tupeln zu finden, weil ich weiß nicht, was Ihr Modell exakt funktioniert wie etwas unter
var transactionsGroupedByDate = [(String,[Int])]()
Jetzt können Sie Indexwert erhalten wie unten,
var index:Int? = nil
for i in 0..<transactionsGroupedByDate.count {
let result = zip(transactionsGroupedByDate[i].1, YOUR_VALUE).enumerated().filter() {
$1.0 == $1.1
}.map{$0.0}
// result gives matches index value from both Int arrays.
if result.count == YOUR_VALUE.count {
index = i
break
}
}
//here you can check index of specific value in tuples
if index != nil {
print(index ?? "failed")
}else {
print("No matched values")
}
Binary Operator '==' kann nicht auf zwei 'Array < myRecord >' Operanden – technogod
angewendet werden @technogod meine Antwort aktualisiert überprüfen –