Thomas Clayson
Thomas Clayson

Reputation: 29925

Stop one cell in a UITableView from being editable

I have a UITableView with cells.

The table view shows a list of downloaded video files. If a video file is downloaded I want them to be able to delete it by sliding - ie: delete a row in a table deletes the file. The table view then resets to show "select to download video".

However, non-downloaded files obviously cannot be deleted. How can I turn off the "slide to delete" on THESE PARTICULAR cells?

Thanks

Upvotes: 3

Views: 409

Answers (1)

nacho4d
nacho4d

Reputation: 45088

You can try: -[UITableViewDataSource tableView:canEditRowAtIndexPath:]
and optionally: -[UITableViewDelegate tableView:editingStyleForRowAtIndexPath:]

;-)

Upvotes: 3

Related Questions