We’ve built data-driven apps that use arrays and objects to store information for display. Now we’re going to work with an app that allows users to interact with, change, and create their own information using a database.
Goals
We’ll explore four ideas:
- Source data versus stored data: Understand how information imported from a CSV becomes independent, persistent application data.
- Data representation: Explore how the same information can be displayed in different ways.
- UX/UI decisions: Consider how interface choices affect how users understand and interact with information.
- Malleable information: Explore how users can create, edit, and delete stored information through appropriate interface elements.
Project Brief / Specification
You’ll work with an existing native iOS application for exploring local coffee shops and maintaining a personal Coffee Journal.
The application uses SwiftUI for its interface and SwiftData for persistent storage. It imports information from a CSV file, displays coffee shop records, supports journal entries, and provides tools for examining and modifying stored data.
This is our baseline or MVP (minimum viable product). You’ll use agentic coding to extend and refine the application, but you remain responsible for evaluating the results and making decisions about its functionality and design.
Step 1: Get the starter project
Download the ZIP file containing our starter project. Move it to your homework folder. Double-click to open it, which will add the following items to your Finder:
CoffeeJournal.xcodeproj– Our project file.CoffeeJournal/– A folder containing project files and assets.coffee_shops.csv– A dataset for the project.AGENTS.md– A set of instructions for your coding agent.
Step 2: Examine the dataset
Open the Coffee Shop Google Sheet. This document is the source of information used in the Xcode project.
Do the following:
- Examine the information and how it is organized.
- Compare the spreadsheet with the supplied
coffee_shops.csvfile, which was exported from the original Google Sheet (it should open in Excel or Numbers by default). - Optionally, open the CSV in a text editor like Visual Studio Code to examine its structure. Note that there is nothing special about it — just a bunch of plain text with a
.csvextension.
Note that the information is the same in both the source sheet and the CSV file. Only its representation has changed.
Our intent with this Xcode project is to alter the representation even further.
Step 3: Explore the application
Open the supplied CoffeeJournal project in Xcode and run it using Canvas. Work through the following steps:
- Verify that the database initially contains zero records.
- Open Data Tools, import the CSV, and confirm that 15 coffee shops appear.
- Explore the Shops, Data Inspector, and Data Tools views.
- Compare the application interface with the Data Inspector. How does each represent the same information?
- Add a coffee shop, modify its information, and create a journal entry.
- Quit and relaunch the application. Are your changes still there?
- Delete one of the imported coffee shops. Check the Data Inspector. What happened to the record?
- Examine the original CSV. Did your changes affect the source data?
- Use Reset and Import to restore the original dataset. Did the deleted coffee shop return?
Ask the coding agent where and how the application stores its records.
Step 4: Make the app your own
Now you get to make decisions about how information should be presented and manipulated.
Make sure the AGENTS.md file is in the project folder. This file provides guidance for what your coding agent can and cannot do.
In Xcode’s toolbar, click on the Coding Assistant toggle above the sidebar, then click on New Conversation and select your coding agent (e.g., Codex) from the dropdown menu. The chat interface will appear.
Start an agent conversation in /plan mode, ask the agent to read and follow AGENTS.md, and wait for confirmation before proceeding.
These are some of the things you should talk through with the agent:
1. Representation
Examine the existing interface. Are the stored values represented appropriately?
SwiftUI provides several controls for presenting and editing information:
- TextField: Enter or edit text.
- Toggle: Switch a Boolean value (true/false) on or off.
- Picker: Choose from a set of options.
- Stepper: Increase or decrease a numeric value.
- DatePicker: Select a date or time.
Consider which controls best represent the information in your application. Which information deserves prominence? Should certain values be displayed differently from how they’re edited? What items should users be able to edit or update in place?
2. Interaction
Decide how users should interact with stored information. Try the following:
- Improve at least one existing interface control or interaction.
- Verify that your change works as intended.
- Consider whether certain values should function as links or other interactive elements.
3. Extension
Add at least one new property to the coffee shop database and provide an appropriate interface control for displaying or modifying it.
Before making changes, create a safety copy of the entire Xcode project — things might break!
With the above precaution in mind, try the following:
- Choose a property that can be optional or have a sensible default value.
- Use
/planto identify the changes needed to the database and interface before implementing them. - Decide where the new information originates and how users will interact with it.
- Do not modify the original CSV or importer unless your extension specifically requires it.
- Verify that existing records remain accessible and that new values persist after quitting and relaunching.
Avoid renaming or removing existing properties, changing their types, or modifying relationships.
Before approving an agent’s plan, review which files it proposes to modify and whether those changes are necessary.
4. Refinement
Make meaningful visual and functional improvements. Use SF Symbols and appropriate SwiftUI controls, but focus on clarity and usability rather than decoration.
You may continue refining the visual design outside class.
Remember: The agent can implement your decisions, but you are responsible for deciding what information matters, how it is presented, and how users interact with it. Also, consider when making a change yourself might be quicker — and use less of your account tokens — than asking the agent.
Save your work. We will use it as the starting point for part two.