I'm building a todo app. I want the user to be able to create tasks as well as categories for the tasks. I'm having some problem trying to figure out how to display the right tasks in the tableview based on which category it belongs to. I also want the user to be able to choose a due date.
Lets say we have an array with the categories, var categories = ["Work", "Private"]
How would I store the task, the category for the task, and the due date? And then access the right task based on which category it belongs to.
if task has category "home" print task.
at first I thought about storing it in a dictionary var tasks = ["Category": "Task"]
but then I couldn't figure out how to access the right tasks based on the categories.
I've tried searching but haven't been able to find the answer anywhere.