user3745888
user3745888

Reputation: 6353

Is possible disable click on accessory View's part of custom UITableViewCell?

I have a custom UITableViewCell in my UITableView of an objective c application. I had a imageView on the left and a label, but now I want add a check in the right position. I have this check added in accessory view into my custom cell, but I have the didSelectRow function too.

enter image description here

How can I disable the didSelectRow in the region of accesoryView? Is it possible?

Upvotes: 3

Views: 242

Answers (3)

AmitaiB
AmitaiB

Reputation: 1708

Though the OP probably has their answer long since, for posterity: this UITableViewDelegate method: tableView(_:accessoryButtonTappedForRowWith:) exists to resolve this issue/mmet this need.

Cheers!

Upvotes: 1

Tim Bernikovich
Tim Bernikovich

Reputation: 5945

You can add UIButton on right side with size you want. In your cell create delegate protocol, VC should implement it and set self as delegate.

Upvotes: 0

Pankaj K.
Pankaj K.

Reputation: 535

You can also make Custom button for your check button. set button click and delegate if you need to perform anything out of your cell class. so when you tap on button you will get button click on that region and if you click on outer space of button you will get did select of tableview.

for better understanding just see bellow image, place your custom check button and change image based on click

Upvotes: 0

Related Questions