Open sl30724 opened 2 years ago
Sorry I'm so late in giving you feedback on this! Looks like you have a great foundation and have made a good start in all this! I love how you've figured out how to make things work and do some things that we haven't discussed or seen at all in class. :)
Your code looks really good overall. I'll provide some thoughts here:
For this list of items and the selected item, using strings is a very common way of doing this kind of thing, but it's not the best way in Swift. It's always good to avoid string comparisons, like the one on line 162. They "work", but they provide surface area for bugs and mistakes when refactoring or renaming things, and they are not really compatible with localizing to other languages. An enum for your item types is the perfect solution, and your items
array could be replaced by using CaseIterable
, which provides the enum with an allCases
array, which gives you all the options.
Your taskCategories
is also a great candidate for that. You can provide your user-facing color names there, and also define the actual colors inside that.
I guess I don't have other specific notes right now, but let me know how things are going and you have any other questions!
I'm excited that I've been able to make my code reusable, and I'm able to overcome issues I run into by researching it online. I've been intimidated by storing and passing data, so I've worked on views so far to get myself familiar with Switch.
November
December