arrayOfTuples = [(4, 4, "id1"), (3, 6, "id2"), (3, 6, "id3")]
How to remove the item with the id2 string?
You can use RangeReplaceableCollection method removeAll(where:) and pass a predicate:
var arrayOfTuples = [(4, 4, "id1"), (3, 6, "id2"), (3, 6, "id3")]
arrayOfTuples.removeAll(where: {$2 == "id2"})
print(arrayOfTuples) // [(4, 4, "id1"), (3, 6, "id3")]
If you would like to remove only the first occurrence where the third element of your tuple is equal to "id2" you can use Collection's method firstIndex(where:):
if let index = arrayOfTuples.firstIndex(where: {$2 == "id2"}) {
arrayOfTuples.remove(at: index)
}