D
D
dimib2014-10-01 12:17:58
iOS
dimib, 2014-10-01 12:17:58

How to track button clicks?

Good day.
I am creating programmatically two buttons: AddImageView, AddLabel.
What should I write so that when I click on a certain one, what I need is done?
I tried
if (AddLabel) {...}
but it's not what I need.
There is no option to create in IB, connect to a specific button and describe it through IBaction.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2014-10-01
@dimib

[_ AddLabel addTarget:self action: @selector (OnAddLabelTap:) forControlEvents:UIControlEventTouchUpInside];
- (void) OnAddLabelTap:(UIButton *) sender {
//
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question