简体   繁体   中英

iOS Creating a user-editable table view

My goal is to create a table view on iOS that allows the user to add/delete the number of rows in the table, and also allows the user to edit the main text (not the right detail text).

So far the solutions I've found for this question involved an additional menu to edit each text (much like the contacts application), or an edit button.

If anyone knows how to go about allowing the user to always edit these cells when they're on that page I'd really appreciate it!

It depends on how you want the user to be able to add rows. You can implement the functions tableView(_:canEditRowAt:) and tableView(_:commit:forRowAt:) to enable deleting, but adding rows is a little more complicated. If you start a new project and in the template select `Master-Detail Application) you will see some boilerplate code that will show you how to do all that

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