In part one, you explored how information moves from a CSV file into a database and becomes available for users to view, modify, and extend. You also explored agentic coding, as well as how presentation and interaction can be affected by UX decisions.
Now you’ll apply those concepts to a dataset of your own choosing.
You’ll use agentic coding to adapt the CoffeeJournal project, making decisions about how your information should be structured, stored, retrieved, presented, and manipulated.
You’ll also examine how an existing application works, identify programming concepts you’ve already learned, and consider how those concepts can be applied to something new.
Goals
We are going to expand upon the concepts explored in part one:
- The differences between source data and stored data.
- How data can be represented in multiple ways.
- How UX/UI decisions can affect representation and interaction.
- The malleability of data — its creation, storage, editing, and deletion.
Step 1: Create your dataset
Choose a subject that interests you and develop a dataset using Google Sheets, Numbers, or Excel:
- Create approximately 8–10 records.
- Identify the properties that describe each record.
- Organize the information into columns, with one record per row.
- Consider which properties contain text, numbers, dates, or Boolean values.
Identify two questions you want your database to answer. For example, a movie database might answer:
- Which movies were released before 1980?
- Which movies have I rated four stars or higher?
Think about how your dataset will support those questions. You may need to add or modify properties.
Step 2: Export your dataset
Export your spreadsheet as a CSV (comma-separated values) file.
Open the CSV in a text editor like Visual Studio Code. Verify that the information and column headings are preserved.
You’ll use this file as the initial source data for your application.
Step 3: Examine and plan
In Finder, create a copy of your original CoffeeJournal project. Open the duplicate project in Xcode. Do not work with the original.
Before making significant changes, also create a safety copy of the new Xcode project — things might break!
Start an agent conversation in /plan mode. Ask the agent to read and follow your AGENTS.md file. Wait for confirmation from the coding agent before proceeding.
Use the following prompt as a starting point:
Please examine my current project. Analyze the following:
* How it imports, stores, retrieves, and displays data.
* The interface elements used to enable user interaction.
I want to use this project as the starting point for a new application based on my own dataset.
Suggest how to adapt the existing application’s data handling, database structure, and interface to accommodate my information.
Identify which parts of the existing project can be reused and which need to change.
Do not write any code or modify the project yet.
Share with the agent your CSV file and the two questions you want your database to answer.
You’re also encouraged to share wireframes, sketches, photographs, color swatches, reference images, or other assets that help communicate your ideas. You can do this simply by dragging files into the chat interface.
Discuss the agent’s recommendations. Ask questions, consider alternatives, and refine the plan before approving implementation.
Step 4: Build the MVP
Your first objective is to create a working MVP (minimum viable product). At the very least, your application should provide the same basic functionality as CoffeeJournal, adapted to your own dataset.
Your application should:
- Import your CSV into SwiftData.
- Display records using appropriate SwiftUI views and controls.
- Allow users to create, view, edit, and delete records.
- Preserve changes between launches.
- Provide ways to retrieve or present information that help answer your two guiding questions.
You may reuse existing components and functionality from CoffeeJournal. You do not need to rebuild features that already work.
Remember what you’ve already learned
In earlier exercises, you used arrays, indexes, List, and ForEach to generate lists of information. You also used NavigationStack and NavigationLink to navigate between lists and individual records. You can review these exercises as a refresher:
Examine how your new application uses these same concepts with database records instead of arrays. You may recognize more of the code than you expect.
Test your application
Verify that the imported information is correct and that you can create, edit, and delete records.
Quit and relaunch the application. Do your changes persist?
Does your application help answer the two questions you identified when creating your dataset?
Remember that changes to stored records should not modify the original CSV.
Step 5: Evaluate and improve
Once your application is working, return to /plan mode. Ask the agent the following:
Keeping in mind the guidelines in my AGENTS.md file, please review my application and suggest efficiencies and possible improvements.
Consider whether the number of SwiftUI View files could be reduced or whether related views could be combined. Also consider opportunities to simplify navigation, including the use of NavigationStack for displaying individual records.
Explain your recommendations and identify which changes would be relatively simple to implement. Do not modify the project yet.
Evaluate the agent’s suggestions:
- Which improvements would make the application more useful?
- Could related views be combined without making the code harder to understand?
- Are there simpler or more appropriate interface controls?
- Could information be organized or presented more effectively?
- Would any suggested changes introduce unnecessary complexity?
Choose improvements worth implementing. You do not have to accept every recommendation.
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.
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.
Consider when making a change yourself might be quicker — and use less of your account tokens — than asking the agent.
Step 6: Reflect
Be prepared to demonstrate your application and explain:
- How your dataset influenced the application’s structure and interface.
- How the application helps answer your two guiding questions.
- What you reused or changed from CoffeeJournal.
- Which agent recommendations you accepted or rejected, and why.