NMIX 6030: Kitchen Buddy App
Spring 2024
Project Overview
With this project, I wanted to learn some new SwiftUI functionalities and draw on some of my knowledge I gained throughout the semester to create a well-designed and challenging final project.
The Problem
I love to cook. Oftentimes, I find myself struggling to do everything that I need to do in the kitchen while navigating between different apps and Google searches on my phone. I wanted to create one app that has multiple important functionalities that I find myself needing while I’m cooking.
The Solution
I decided to take the two most important things I need in the kitchen: a timer and a measurement converter, and put them into one app. I also added a shopping list mode to add some extra features.
TimerView
The TimerView consists of picker wheels to select hours, minutes and seconds, along with a countdown display and a start/stop button that toggles based on a State variable.
I did some research online to figure out how to use SwiftUI’s Timer class, using ChatGPT to help with the logic to make the timer countdown work.
ListView
ListView comprised of a list of shopping items with checkboxes for marking completion and a text field for adding new items to the list.
This view used SwiftUI’s List and TextField components to create the list and input field. Additionally, the checkbox functionality was implemented using a boolean state variable in the ShoppingItem struct.
ConvertView
ConvertView required a text field for inputting a number value, pickers to select units, and a section to display the converted value.
I used SwiftUI’s form and picker components heavily in this view. Through some help from ChatGPT, I learned how to use the onChange modifiers to trigger the value conversion when the input changes.
The actual conversion part was simpler than I thought it would be. It only involved implementing Swift’s Measurement and Unit classes.
Challenges faced
Timer Logic
Managing the timer’s start/stop functionality and updating the countdown display accurately required careful handling of state and timer events.
List Management
Managing dynamic list updates, such as adding and deleting items in the shopping list, required handling state mutations and UI updates effectively.
Unit Conversion
Ensuring accurate and consistent unit conversion across various units was challenging. I relied on Swift’s built-in Measurement and Unit classes to handle conversions.
Results
Overall, I am happy with the final result of this project. Through this project, I learned a lot about SwiftUI forms from our class textbook.
I still think I have a lot to learn when it comes to using SwiftUI, as it is a much more complicated type of coding than HTML and Javascript like I am used to through my Web Dev classes. But this project made me feel more confident in my abilities to use online resources and AI to aid me in creating a decent app.