sl30724 / PlanningApp

This app is made for Mobile App Dev 2022 Fall class
0 stars 0 forks source link

Progress #2

Open sl30724 opened 2 years ago

sl30724 commented 2 years ago

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.

zef commented 1 year 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:

https://github.com/sl30724/PlanningApp/blob/d7e320caad9f5abb02f3b7493478af9f08659640/Planning/Views/ContentView.swift#L98-L102

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!