Swift 3 2d array of Int
<p>It's actually a very simple question, but after an hour I can not solve my problem.</p>

<p>I need to create a 2d array of Int.</p>

<pre><code>var arr = [[Int]]()
or
var arr : [[Int]] = []
</code></pre>

<p>tried to change value :</p>

<pre><code>arr[x][y] = 1
</code></pre>

<p>fatal error: Index out of range</p>

<p>Should I use APPEND or I need specify the size of the array?</p>

<p>I'm confused..</p>