In swift, I cannot figure out how to check if a multi-dimensional array contains a child array.
var a: [[Int]] = []
a.append([1,2])
a.append([2,2])
a.append([3,2]) #=> [[1,2], [2,2], [3,2]]
a.contains([1,2]) #=> Contextual type '@noescape ([Int]) throws -> Bool' cannot be used with array literal.
I've tried all kinds of combinations and .indexOf and can't get anything to work.
What am I missing?
a.contains { $0 == [1,2] }. indexOf has also a predicate-based variant:a.indexOf { $0 == [1,2] }.