user705414
user705414

Reputation: 21200

UIButton's click action?

I am following a book to learn IOs programming. For UIButton, it supposed to have a click action. However I only saw some actions like touch down etc.

Also, want to know why the default action not the "touch down" but "touchUpInside"

I am using XCode 4.3.

Upvotes: 2

Views: 1108

Answers (2)

Rohit Gupta
Rohit Gupta

Reputation: 408

In storyboard, you can right click on the UIButton and see the list of events available for a UIButton and choose appropriate event based on your requirement.

For a click like action you can use Touch Up Inside event.

Upvotes: 0

Omar Abdelhafith
Omar Abdelhafith

Reputation: 21221

click action in iOS is represented but touchUpInside, since click is a mouse event

touchUpInside, means that the user touched down on a button, and then touch up, while he still is on the same button, which is the normal behavior when you want to tap on a button

Upvotes: 4

Related Questions