How to find the index of an item in a multidimensional array swiftily?
<p>Let's say I have this array:</p>

<pre><code>let a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
</code></pre>

<p>Now I want something like this:</p>

<pre><code>public func indicesOf(x: Int, array: [[Int]]) -&gt; (Int, Int) {
    ...
}
</code></pre>

<p>so that I can call it like this:</p>

<pre><code>indicesOf(7, array: a) // returns (2, 0)
</code></pre>

<p>Of course, I can use:</p>

<pre><code>for i in 0..&lt;array.count {
    for j in 0..&lt;array[i].count {
        if array[i][j] == x {
            return (i, j)
        }
    }
}
</code></pre>

<p>But that is not even close to swifty!</p>

<p>I want a way to do this which is swifty. I think maybe I can use <code>reduce</code> or <code>map</code>?</p>