How to trigger UIButton action programmatically
3 answers
You can just call the action method of the first class as an instance method from other classes by passing the UIbutton id
eg: in the first class " ClassA "
- (IBAction)classAbuttonAction1:(id)sender;
- (IBAction)classAbuttonAction2:(id)sender;
from another class
UIButton *bClassButton = [[UIButton alloc]init];
ClassA *instance = [[ClassA alloc]init];
[instance classAbuttonAction1:bClassButton];
[instance classAbuttonAction2:bClassButton];
0
source to share