title: Swift 3 - Create for loop UIButtons
body: <p><strong>Hello guys, I create 14 buttons in for loop but each 7 buttons in one variable for example:</strong></p>
  
  <pre><code>for i in 0...6 {
      var button = UIButton()
      ...
      var button2 = UIButton()
      ...
  }
  </code></pre>
  
  <p><strong>But I want create 14 buttons in one variable with for loop like in the picture:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/v0UJG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v0UJG.png" alt="enter image description here"></a> </p>
  
  <p><strong>In the picture I do it with two buttons in one for loop</strong></p>
  
  <p><strong>And my sizes, xAxis and yAxis it must be :</strong></p>
  
  <pre><code>let buttonWidth = self.view.frame.size.width / 7
  var xAxis : CGFloat = 1
  let yAxis : CGFloat = self.view.frame.size.height - (tileWidth * 2) - 100
  let yAxis2 : CGFloat = self.view.frame.size.height - (tileWidth + 100)
  </code></pre>
  
  <p><strong>So how can I create 14 button with using for loop with same sizes and axises ? like this :</strong></p>
  
  <pre><code>for i in 0...13 {
  
      var button = UIButton()
      ...
  
  }
  </code></pre>