简体   繁体   中英

UITableView Edit Mode by default

I am trying to have a tableView which have edit button to remove cells by default. Is there anyway to achieve that rather than selecting edit button and then to get to edit mode?

Thanks

Editing mode is a state of the UITableView . You can set it programmatically with:

[tableView setEditing:YES animated:YES]

You can do this anytime, with or without animation.

Set the table view to editing mode as soon as it appears. In your viewWillAppear method:

self.tableView.editing = YES;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM