I'm currently using Xcode 4.6 and I'm simply wondering how to select multiple buttons across different UIViews, but under a single view controller. CMD clicking doesn't seem to work. I need this functionality because in Xcode 4.6 the only way to let two buttons on IB to share the same action is to select them at once and then drag the action to your view controller.
My ultimate goal is to get two different buttons on two different UIViews to match the same action using storyboards in Xcode 4.6. Is there a way to do this?
EDIT: I'm currently using Xcode 4.6.1 without any luck, upgrading to 4.6.2.
You can connect multiple buttons to a single action without selecting them all at once.
However, after creating the action, you need to save the source file containing the action before Xcode will let you connect another control to the action.
I did this with Xcode 4.6.2:
Swift 3.0 Xcode 8.0+
Connect all buttons to below method signature. Make sure argument sender is of type UIButton (Or subclass of UIButton) in-order to connect rest of the buttons from storyboard.
@IBAction func dialconfigTapped(_ sender: UIButton) {}
Use sender.tag to identify the tapped button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With