title: Swift How to use Switch statement in method with 4 inputs(SENDER)
body: <p>I have a problem! This code is works fine in my veiwController. But I want to move it into my struct and just call a function! This one</p>
  <pre><code>@IBOutlet weak var billTextField: UITextField!
  @IBOutlet weak var zeroPctButton: UIButton!
  @IBOutlet weak var tenPctButton: UIButton!
  @IBOutlet weak var twentyPctButton: UIButton!
  @IBOutlet weak var splitNumberLabel: UILabel!
  
  
  @IBAction func tipChanged(_ sender: UIButton) {
     
      
      
      billTextField.becomeFirstResponder()
      
      switch sender {
      case zeroPctButton:
          zeroPctButton.isSelected = true
          tenPctButton.isSelected = false
          twentyPctButton.isSelected = false
          billTextField.endEditing(true)
      case twentyPctButton:
          tenPctButton.isSelected = false
          zeroPctButton.isSelected = false
          twentyPctButton.isSelected = true
          billTextField.endEditing(true)
      case tenPctButton:
          twentyPctButton.isSelected = false
          zeroPctButton.isSelected = false
          tenPctButton.isSelected = true
          billTextField.endEditing(true)
      default:
          print(&quot;error&quot;)
      }
  </code></pre>
  <p>After I try to create my method with 4 inputs, it didn't work!</p>
  <pre><code>    struct Switch {
  
  
  
      func switchButton(zero: UIButton, ten: UIButton, twenty: UIButton, bill: UITextField)  {
          
          switch UIButton() {
          case zero :
          zero.isSelected = true
          ten.isSelected = false
          twenty.isSelected = false
          bill.endEditing(true)
          
          case twenty :
        ten.isSelected = false
          zero.isSelected = false
         twenty.isSelected = true
       bill.endEditing(true)
          case ten:
          twenty.isSelected = false
          zero.isSelected = false
          ten.isSelected = true
          bill.endEditing(true)
      default: print(&quot;Error&quot;)
  </code></pre>
  <p>And when I change switch Uibutton() to zero(for example) it works with this one button!</p>
  <pre><code>    struct Switch {
  
  
  
      func switchButton(zero: UIButton, ten: UIButton, twenty: UIButton, bill: UITextField)  {
          
          switch zero {
          case zero :
          zero.isSelected = true
          ten.isSelected = false
          twenty.isSelected = false
          bill.endEditing(true)
          
          case twenty :
        ten.isSelected = false
          zero.isSelected = false
         twenty.isSelected = true
       bill.endEditing(true)
          case ten:
          twenty.isSelected = false
          zero.isSelected = false
          ten.isSelected = true
          bill.endEditing(true)
      default: print(&quot;Error&quot;)
  </code></pre>
  <p>And I tried to use nested func but didn't work for me( I also created another struct with 4 inputs which I add to code into my main struct.
  And I tried to so many many things that I just can't stop! Help me understand please!</p>