Adding Rows
There are a number of ways to add rows to a table view at runtime. The built-in behavior for adding a row is to display a new row with a green plus sign icon. However, this technique has fallen out of favor in iOS applications because it’s cumbersome to enter editing mode and then find the row with the plus sign icon – especially in larger tables.
So we’re going to put a button in the header view instead. Recall that when a table view first appears on screen, it asks its data source for the data it needs to display, and the data source provides it. You can force this process to run again by sending the message reloadData to the table view. That way, if you add a Possession to the PossessionStore, you can reload the table, and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access