Button Tap Fires all buttons

Hello all:


I have a very simple IOS app in Swift that has 3 buttons on it. I used the assitant editor and teh <ctrl> key click and drag to create the functions for the buttons:


@IBAction func button1_Tap(_ sender: Any){ print("Button 1") }

@IBAction func button2_Tap(_ sender: Any){ print("Button 2") }

@IBAction func button3_Tap(_ sender: Any){ print("Button 3") }


but for some reason, tapping any of the buttons fires all 3 functions.


Any ideas are appreciated!


John.

Accepted Reply

Look at the Connections inspector for each button in IB.


It is likely that you have several (the 3) IBActions connected to some Sent Events.


Remove the extra 2 in each.


Note: that could happen if you copied buttons (or option drag one): IBActions are copied as well.

Replies

Look at the Connections inspector for each button in IB.


It is likely that you have several (the 3) IBActions connected to some Sent Events.


Remove the extra 2 in each.


Note: that could happen if you copied buttons (or option drag one): IBActions are copied as well.

That was it, thanks!