简体   繁体   English

UIButton在Touches内部向上触摸

[英]UIButton Touch Up Inside TouchesBegan

I create UIButton on my StoryBoard, and create Outlet for this UIbutton, then for Touch Up Inside I create some method. 我在StoryBoard上创建UIButton,并为此UIbutton创建Outlet,然后为Touch Up Inside创建一些方法。 In standard button have method aka TouchesEnded 在标准按钮中有方法aka TouchesEnded

Maybe that is stupid questions, I new in Xcode but I ask How I can switch on this button on TouchesBegan? 也许这是愚蠢的问题,我是Xcode的新用户,但我问如何在TouchesBegan上打开此按钮?

Thx 谢谢

create your IBAction for your UIButton and connect your button to IBAction . UIButton创建IBAction并将按钮连接到IBAction for when you tapped on button then your method is call. 当您点击按钮时,将调用您的方法。

Such like method, 这样的方法

-(IBAction)butttonTaped:(UIButton *) Sender
{
   // connect to your button
}

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

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