title: could not cast value of type UIView to UIButton
body: <p>i have made the game tic tac toe in swift .. the game is completed i am stuck on the last bit that when the user presses the play again button i want to set all the buttons images back to nil so that the user can start playing the game again. i used the tag property to set it back to nil. i coded this : </p>
  
  <pre><code>for i = 0 ; i &lt; 8 ; i++ {
    var button = view.viewWithTag[i] as! UIButton
    button.setImage(nil, forState:.normal)
  }
  </code></pre>
  
  <p>but it gives error</p>
  
  <blockquote>
    <p>could not cast value of type UIView to UIButton</p>
  </blockquote>