title: Subscript Options in iOS Swift
body: <p>I have got a tutorial from which I was studying Swift &amp; about Subscript Options. The below is a simple code of documentation's example on this topic.</p>
  
  <pre><code>struct Matrix {
      let rows: Int, columns: Int
      var print: [Double]
      init(rows: Int, columns: Int) {
          self.rows = rows
          self.columns = columns
          print = Array(count: rows * columns, repeatedValue: 0.0)
      }
      subscript(row: Int, column: Int) -&gt; Double {
          get {
              return print[(row * columns) + column]
          }
          set {
              print[(row * columns) + column] = newValue
          }
      }
  }
  var mat = Matrix(rows: 3, columns: 3)
  
  mat[0,0] = 1.0
  mat[0,1] = 2.0
  mat[1,0] = 3.0
  mat[1,1] = 5.0
  
  println("\(mat[0,0])")
  println("\(mat[0,1])")
  println("\(mat[1,0])")
  println("\(mat[1,1])")
  </code></pre>
  
  <p>Can any one please explain me what is going on here. I am unable to make out about Subscript Options from this example. And might be there would be many like me. Thanks in advance.</p>