Creating a class to represent a journal entry
To create a model object that can represent a journal entry in your app, you will add a new file to your project, JournalEntry.swift
, and declare a JournalEntry
class that has the required properties for a journal entry. Before you do so, you’ll configure your project to use Swift 6 and change the main project folder to a group. Follow these steps:
- In the Project navigator, click the JRNL icon. Click the JRNL target and click Build Settings. Scroll down to Swift Compiler – Language and set Swift Language Version to Swift 6:
Figure 15.3: Editor area showing Build Settings with Swift 6 set
- Right-click on the blue JRNL project folder under the JRNL icon and choose Convert to Group:
Figure 15.4: Pop-up menu with Convert to Group selected
The folder color will change from blue to dark gray. Making the folder a group will allow you to rearrange the order of the files in it.
...