title: Toggle between three states with UIButton
body: <p>I have a <code>UIButton</code> for which I want to switch the title and color when I press it. The button should have three states: daily, monthly and yearly.</p>
  
  <p>Right now I have this solution which doesn't seem that elegant:</p>
  
  <pre><code>if sender.currentTitle == "Daily" {
      sender.setTitle("Monthly", for: .normal)
      sender.setTitleColor(UIColor(hex: "FB967F"), for: .normal)
  } else if sender.currentTitle == "Monthly" {
      sender.setTitle("Yearly", for: .normal)
      sender.setTitleColor(UIColor(hex: "A395CE"), for: .normal)
  } else if sender.currentTitle == "Yearly" {
      sender.setTitle("Daily", for: .normal)
      sender.setTitleColor(UIColor(hex: "75CFF8"), for: .normal)
  }
  </code></pre>
  
  <p>Is there a more convenient way to do this in Swift ?</p>