When I go shopping, I use the Notes application on my iPhone. I've long hated it. I add items that I want to buy to a list, I forget that I have duplicate items, my list is long and when I search for an item I don't see it, I have duplicates. I wanted a new app, so I asked ChatGPT to build one for me.
I now use this app for shopping and it's much easier to use.
The following was my query:
I would like to create a small shopping list app in Swift for the iPhone. I have a newer version of XCode, so I have ContentView instead of Main.storyboard.
- The app should allow me to enter and delete food items to buy.
- Each entry should have a checkbox to the left. Unchecked items should appear at the top, checked items at the bottom.
- At the top of the screen should be a large title which says “Shopping.”
- At the bottom of the screen should be two buttons. One says “Alpha” and the other says “Frequency.”
- If I click on the button which says “Alpha”, all items should be sorted first by unchecked and the checked status. A secondary, alphabetical sort for each checked and unchecked section.
- If I click on the button which says “Frequency,” all items should be sorted first by unchecked and the checked status. A secondary, sort for the frequency with which I first entered or unchecked each item.
- The application needs storage to save the number of times I’ve entered or unchecked each item.
- After I close and reopen the app, it should show the list in the last state it was observed.
- If I delete an item from the list, it should also be deleted from storage.
From there, it was asking it to fill in various sections, correct errors I found, and add a few new features I discovered I wanted.
While I've done some Android development with Kotlin, I have never done iOS development, nor do I know the Swift programming language.
I am continuing to add new features to the appliction, small adjustments, one at a time, while I learn more about what I want and what I can do. You can follow along with my original session building the application.
This project is available under the MIT license.