title: Swift - determine which button was pressed with switch
body: <p>I have 4 buttons that call one function. Depending on which button was pressed i need to hide button inside of function that called after pressing.I dont know which button was pressed so i tried to assign tags for each of 4 buttons to identify them by tag and use switch</p>
  
  <p>I tried this</p>
  
  <pre><code>            switch sender.tag {
              case 1:
                  self.button1.hidden = true
              case 2:
                  self.button2.hidden = true
              case 3:
                  self.button3.hidden = true
              case 4:
                  self.button4.hidden = true
  
              }
  </code></pre>
  
  <p>but this doesnt work compiler says about use of unresolved identifier 'sender'</p>
  
  <p>How to do this correctly ?</p>
  
  <p>EDIT:</p>
  
  <p>Whole function</p>
  
  <pre><code>  if self.allowMistakeVar {
  
          let mistakeAlert = UIAlertController(title: "Here is title!", message: "message of alert", preferredStyle: .Alert)
          let okay = UIAlertAction(title: "OK", style: .Cancel) { UIAlertAction in
  
              self.allowMistakeVar = false
              self.allowMistakeButton.enabled = false
  
  
              switch sender.tag {
              case answer1Text:
                  self.answer1Text.hidden = true
              case answer2Text:
                  self.answer2Text.hidden = true
              case answer3Text:
                  self.answer3Text.hidden = true
              case answer4Text:
                  self.answer4Text.hidden = true
  
              }
  
          }
  
          mistakeAlert.addAction(okay)
          self.presentViewController(mistakeAlert, animated: true, completion: nil )
  
      } else {
  </code></pre>
  
  <p>another case..
  }</p>