title: How to programmatically add tags to a UIButton in Swift
body: <p>I know how to add tags in <code>main.storyboard</code> files, but now I am working on creating everything programmatically. However, I couldn't find anything online that tells me how to add tags to a button. I tried to read the apple documentation but don't know how to implement it.</p>
  
  <p>Here is for example how I created my button, how can I add a tag to it, so that when I make multiple buttons and want to link them to a single action I can know what button has been pressed?</p>
  
  <pre><code>let buttonOne() : UIButton { 
     let button = UIButton(type: .system)
     button.backgroundColor = .red
     return button
  }()
  </code></pre>