How to connect multiple buttons in a storyboard to

2019-01-11 17:36发布

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.

7条回答
放荡不羁爱自由
2楼-- · 2019-01-11 18:38

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:

connecting buttons to action

查看更多
登录 后发表回答