title: Swift: How to check if a certain button pressed inside function?
body: <p>I am new to Swift and Xcode and having some problems with checking whether certain button is pressed or not inside a function. Seems I can not just use isTouchInside here and was wondering if there is another way of doing it. Should I create another button action with tags and use it in my current function or is there an easier way to solve it?      </p>
  
  <pre><code>    func nextQuestion1(){
      TextView.text = "Choose word Yellow"
      stackView.isHidden = false
      playBtn.isHidden = true
  
      if btn1.isTouchInside {
          mondaiNumber.isHidden = false
  
      }
      else {
          mondaiNumber.isHidden = true
      }
  
      let when = DispatchTime.now() + 3
      DispatchQueue.main.asyncAfter(deadline: when) {
          self.nextQuestion2()
  
  }
      return
  }
  </code></pre>