简体   繁体   English

如何使用Storyboard在Xcode6中创建UIButton连接?

[英]How to create UIButton connections in Xcode6 using Storyboard?

Can any one explain me , how can we set action for UIButton, which is created in swift storyboard. 谁能解释一下,如何设置在快速情节提要中创建的UIButton的动作。 In iOS 7 we can connect directly by drag and drop by selecting touchupinside but in Xcode6 i am not able to find that. 在iOS 7中,我们可以通过选择touchupinside拖放来直接连接,但是在Xcode6中我找不到它。

It's still there. 它仍然在那里。 Don't forget to add a custom class for the controller: 不要忘记为控制器添加一个自定义类:

在此处输入图片说明

Then you'll be able to control-drag from storyboard to the class definition in swift file (because there is no @interface section in swift) or to the yellow controller icon in the interface builder. 然后,您就可以控制从情节提要板拖到swift文件中的类定义 (因为swift中没有@interface部分)或拖到界面构建器中的黄色控制器图标上。

Did you hold the "ctrl" key? 您是否按住了“ Ctrl”键? hold "ctrl" and drag. 按住“ Ctrl”并拖动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM