DevFly
DevFly

Reputation: 423

Is this efficient - adding gesture recogniser to every UITableViewCell

is it efficient for the app to add a gesture recogniser to every cell in a table view. The cells can be as less as 10 or as much as 1000.

I mean will it effect scrolling behaviour, memory usage, and general stability?

And the cells are custom cells with 3 labels with different colors.

Thank you!

Upvotes: 2

Views: 87

Answers (2)

Josh
Josh

Reputation: 3475

It depends how you do it. Table cells memory management is very good, that's what the [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; is all about. So if you made sure you didn't have hundreds of gesture recognizers then there shouldnt be a problem. Try and make it so that you only have as many as there are resuable cells.

Upvotes: 2

Alexander
Alexander

Reputation: 8147

Since the UITableView reuses cells the performance will be pretty much the same for 10 and 1000 cells (depends on how much fit on a single page of the table). Table cells already have gesture recognizers (the swipe to delete gesture), so you should have no problem doing so, too.

Upvotes: 2

Related Questions