I created list of todos. Now I want to put the checkbox for each one cell. When I mark it as checked, it can be marked and then we select delete button if we want, which is also in the same cell at right side and deleted, but I am not able to perform action like this.
Can anyone please help me?
@Chakradhar not a big issue you can do it very easily with or without using custom images.
In your didSelectRowAtIndexPath
delegate try to check and set the UITableViewCellAccessory
as per your condition.
This is the way in which there is no need to use extra images and you can checked for you particular selected cell:
if (//here you check)
{ // item needed - display checkmark
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
else
{ // not needed no checkmark
cell.accessoryType = UITableViewCellAccessoryNone;
}
Take this shopping tutorial and see didSelectRowAtIndexPath
delegate method see how they had used the condition.
Edited as per your last comment: For custom accessory view look for Implement a Custom Accessory View For UITableView in iPhone
Good Luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With