Chatar Veer Suthar
Chatar Veer Suthar

Reputation: 15639

how can I put an edit button in UITable at the end of a cell?

I want to put a edit button(icon), as most application has in the cell where the value exists???

I want as below output,

Hotel Royal > Hotel Taj >

shows the button or icon, how can I do it ???

if you don't understand my question, you may ask again .....

Upvotes: 1

Views: 250

Answers (1)

Matthias Bauch
Matthias Bauch

Reputation: 90117

If you are asking for the > you see at the cells, these are accessoryViews. You can get the standard accessory views by setting the accessoryType property of the cell

for enter image description here you use

cell.accessoryType = UITableViewCellAccessoryCheckmark;

for enter image description here

cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;

and for enter image description here

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

if you use the DetailDisclosure button you can get the taps on it with the tableview delegate method - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath

Upvotes: 3

Related Questions