title: 'UIButton.titleLabel?.text' doesn't work as expected/doesn't overwrite string
body: <p>My problem is as follows:</p>
  
  <pre><code>var player = 2
  
  @IBOutlet weak var label: UILabel!
  @IBOutlet weak var button1: UIButton!
  @IBOutlet weak var button2: UIButton!
  @IBOutlet weak var button3: UIButton!
  
  func CheckWin() -&gt; Bool
  {
      if button1.titleLabel?.text == button2.titleLabel?.text &amp;&amp; button2.titleLabel?.text == button3.titleLabel?.text &amp;&amp; button1.titleLabel?.text != nil
      {
          return true
      }
      else
      {
          return false
      }
  }
  
  @IBAction func buttonClick(_ sender: UIButton)
  {
      if sender.titleLabel?.text == nil
      {
          if player%2==0
          {
              sender.setTitle("X", for: UIControlState.normal)
              player += 1
              turn += 1
              label.text = "Player 'O' Turn"
          }
          else
          {
              sender.setTitle("O", for: UIControlState.normal)
              player += 1
              turn += 1
              label.text = "Player 'X' Turn"
          }
      }
      if CheckWin()
      {
          resetButtons()
      }
  }
  
  func resetButtons() {
  
      button1.titleLabel?.text = nil
      button2.titleLabel?.text = nil
      button3.titleLabel?.text = nil
  }
  </code></pre>
  
  <p>I'm trying to reset the Button's-text to nil (empty/no text), to restart the Game. It all works fine but when it comes to the "func resetButtons()"-Method it puts the visible text from the buttons to nil but somehow the the text is still "X" or "O". </p>
  
  <p>I've tried to use button1.setTitle(nil) and other different writings in the resetButtons()-Method but it doesn't change a thing. I also tried changing Settings from .System to Custom - didn't work either.
  Everytime I debug it and go the breakpoint it shows that still after "resetButton()" should have changed the Buttontext it still is "X" or "O", but visibly the button is empty as it should be... it is really weird.</p>
  
  <p>I figured out that the problem might be, that when I set the Button-text at first, it's "sender.titleLabel?.text" and not "button1.titleLabel?.text". Could that really be the problem?</p>
  
  <p>Thanks in advance!</p>