Passing data from the Add New Journal Entry screen to the Journal List screen
As shown in the app tour in Chapter 10, Setting Up the User Interface, the Add New Journal Entry screen allows the user to enter data to create a new journal entry. To do so, the user will click the + button in the top-right corner of the Journal List screen to display the Add New Journal Entry screen. The user will then enter the details for the new journal entry. Clicking the Save button will dismiss the Add New Journal Entry screen and a new row containing a table view cell is added to the table view on the Journal List screen. The table view cell will display the photo, date, and title of the newly added journal entry.
For this to work, you’ll implement the prepare(for:sender:)
method for the view controller managing the Add New Journal Entry screen. This method is triggered when you go from one view controller to another. With this method, you’ll create a new journal entry using the...