0

I need to check when User taps the button to do next actions. How it can be implemented? For example, I have this button:

@IBAction func ButtonSender(_ sender: UIButton) {

}

and I need to know when it is tapped.

Ahmad F
  • 30,560
  • 17
  • 97
  • 143
RampSt
  • 11
  • 4

2 Answers2

-1

This is very simple

@IBAction func ButtonSender(_ sender: UIButton) {
      yourFunction()
      print("The button was tapped")
}
Vyacheslav
  • 26,359
  • 19
  • 112
  • 194
-1

Build a variable of type Boolean initialize it with false then after hitting button change its value to true..

    @IBAction func ButtonSender(_ sender: UIButton) {
    isButtonTapped = true
    }