Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulate a UIButton Click event using code

Tags:

ios

How to simulate physical touch on UIButton using code? what I want is the UIButton changes to a hightlight state and then back to normal state again like it's been clicked by a real finger.

like image 558
Xin Yuan Avatar asked May 04 '26 01:05

Xin Yuan


1 Answers

[button sendActionsForControlEvents:UIControlEventTouchUpInside];
like image 145
Szu Avatar answered May 05 '26 16:05

Szu