The task API will accept new tasks as POST requests containing JSON representations of the tasks and will return all the existing tasks via GET requests.
First, let's define a task--in the App group of your XCode project, create a new file called Task.swift in the Models group.
After creating this file, ensure that it is a member of the App target and not any others. The Target Membership panel for our new file should look like this:
Now, let's define our task as having two properties: a description and a category, plus an identifier:
class Task { let id: String var description: String var category: String init(id: String, ...