Adding a Todo task

So far, the app works very well, presenting all the Todo tasks, but we need to allow the user to create their own Todo task.

The add a Todo view

As the specifications require that a Todo task is editable, it makes sense to use the same View Controller either to create a new Todo task, or to edit an already existing Todo task.

To implement the desired layout, we are going to use a TableViewController class again using static cells so that we can configure and lay it out directly in Interface Builder.

Add another TableViewController class close to TodoTableViewController, and after selecting the Table View inside, set the content as Static Cells instead of Dynamic Cells.

Then, select the first and only section, that is, Table View ...

Get Swift 2 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.