{"id":4388,"date":"2026-10-19T16:01:10","date_gmt":"2026-10-19T16:01:10","guid":{"rendered":"https:\/\/nmi.cool\/appdev\/?page_id=4388"},"modified":"2026-10-19T16:01:10","modified_gmt":"2026-10-19T16:01:10","slug":"homework-12-working-with-data-part-one-a-coffee-shop-journal","status":"publish","type":"page","link":"https:\/\/nmi.cool\/appdev\/homework-12-working-with-data-part-one-a-coffee-shop-journal\/","title":{"rendered":"Homework 12: Working with Data, Part One \u2013 A Coffee Shop Journal"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">We&#8217;ve built data-driven apps that use arrays and objects to store information for display. Now we&#8217;re going to work with an app that allows users to interact with, change, and create their own information using a database.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Goals<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll explore four ideas:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Source data versus stored data:<\/strong> Understand how information imported from a CSV becomes independent, persistent application data.<\/li>\n\n\n\n<li><strong>Data representation:<\/strong> Explore how the same information can be displayed in different ways.<\/li>\n\n\n\n<li><strong>UX\/UI decisions:<\/strong> Consider how interface choices affect how users understand and interact with information.<\/li>\n\n\n\n<li><strong>Malleable information:<\/strong> Explore how users can create, edit, and delete stored information through appropriate interface elements.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Project Brief \/ Specification<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll work with an existing native iOS application for exploring local coffee shops and maintaining a personal Coffee Journal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The application uses <strong>SwiftUI<\/strong> for its interface and <strong>SwiftData<\/strong> 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is our baseline or <strong>MVP (minimum viable product)<\/strong>. You&#8217;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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Get the starter project<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Download the <a href=\"http:\/\/nmi.cool\/appdev\/wp-content\/uploads\/sites\/17\/2026\/10\/Homework-12-CoffeeJournal.zip\">ZIP file<\/a> containing our starter project.  Move it to your homework folder.  Double-click to open it, which will add the following items to your Finder:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>CoffeeJournal.xcodeproj<\/code> \u2013 Our project file.<\/li>\n\n\n\n<li><code>CoffeeJournal\/<\/code> \u2013 A folder containing project files and assets.<\/li>\n\n\n\n<li><code>coffee_shops.csv<\/code> \u2013 A dataset for the project.<\/li>\n\n\n\n<li><code>AGENTS.md<\/code> \u2013 A set of instructions for your coding agent.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 2: Examine the dataset<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open the <a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1WFcJOjYMEO8NtVENeg3FoN1Ad-pa22wvC28ykWOzcxg\/edit?usp=sharing\">Coffee Shop Google Sheet<\/a>. This document is the source of information used in the Xcode project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Examine the information and how it is organized.<\/li>\n\n\n\n<li>Compare the spreadsheet with the supplied <code>coffee_shops.csv<\/code> file, which was exported from the original Google Sheet (it should open in Excel or Numbers by default).<\/li>\n\n\n\n<li>Optionally, open the CSV in a text editor like Visual Studio Code to examine its structure.  Note that there is nothing special about it \u2014 just a bunch of plain text with a <code>.csv<\/code> extension.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Note that the information is the same in both the source sheet and the CSV file. Only its representation has changed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our intent with this Xcode project is to alter the representation even further.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 3: Explore the application<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open the supplied CoffeeJournal project in Xcode and run it using Canvas.  Work through the following steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Verify that the database initially contains zero records.<\/li>\n\n\n\n<li>Open <strong>Data Tools<\/strong>, import the CSV, and confirm that 15 coffee shops appear.<\/li>\n\n\n\n<li>Explore the Shops, Data Inspector, and Data Tools views.<\/li>\n\n\n\n<li>Compare the application interface with the Data Inspector. How does each represent the same information?<\/li>\n\n\n\n<li>Add a coffee shop, modify its information, and create a journal entry.<\/li>\n\n\n\n<li>Quit and relaunch the application. Are your changes still there?<\/li>\n\n\n\n<li>Delete one of the imported coffee shops. Check the Data Inspector. What happened to the record?<\/li>\n\n\n\n<li>Examine the original CSV. Did your changes affect the source data?<\/li>\n\n\n\n<li>Use <strong>Reset and Import<\/strong> to restore the original dataset. Did the deleted coffee shop return?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Ask the coding agent where and how the application stores its records.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 4: Make the app your own<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now you get to make decisions about how information should be presented and manipulated.<br><br>Make sure the <code>AGENTS.md<\/code> file is in the project folder. This file provides guidance for what your coding agent can and cannot do.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Xcode&#8217;s toolbar, click on the <strong>Coding Assistant<\/strong> toggle above the sidebar, then click on <strong>New Conversation<\/strong> and select your coding agent (e.g., Codex) from the dropdown menu. The chat interface will appear.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start an agent conversation in <code>\/plan<\/code> mode, ask the agent to read and follow <code>AGENTS.md<\/code>, and wait for confirmation before proceeding.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These are some of the things you should talk through with the agent:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Representation<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Examine the existing interface. Are the stored values represented appropriately?<br><br>SwiftUI provides several controls for presenting and editing information:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>TextField:<\/strong> Enter or edit text.<\/li>\n\n\n\n<li><strong>Toggle:<\/strong> Switch a Boolean value (true\/false) on or off.<\/li>\n\n\n\n<li><strong>Picker:<\/strong> Choose from a set of options.<\/li>\n\n\n\n<li><strong>Stepper:<\/strong> Increase or decrease a numeric value.<\/li>\n\n\n\n<li><strong>DatePicker:<\/strong> Select a date or time.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Consider which controls best represent the information in your application. Which information deserves prominence? Should certain values be displayed differently from how they&#8217;re edited? What items should users be able to edit or update in place?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Interaction<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Decide how users should interact with stored information.  Try the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Improve at least one existing interface control or interaction.<\/li>\n\n\n\n<li>Verify that your change works as intended.<\/li>\n\n\n\n<li>Consider whether certain values should function as links or other interactive elements.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Extension<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Add at least one new property to the coffee shop database and provide an appropriate interface control for displaying or modifying it.<br><br><strong>Before making changes, create a safety copy of the entire Xcode project \u2014 things might break!<\/strong><br><br>With the above precaution in mind, try the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Choose a property that can be optional or have a sensible default value.<\/li>\n\n\n\n<li>Use <code>\/plan<\/code> to identify the changes needed to the database and interface before implementing them.<\/li>\n\n\n\n<li>Decide where the new information originates and how users will interact with it.<\/li>\n\n\n\n<li>Do not modify the original CSV or importer unless your extension specifically requires it.<\/li>\n\n\n\n<li>Verify that existing records remain accessible and that new values persist after quitting and relaunching.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Avoid renaming or removing existing properties, changing their types, or modifying relationships.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before approving an agent&#8217;s plan, review which files it proposes to modify and whether those changes are necessary.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Refinement<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Make meaningful visual and functional improvements. Use SF Symbols and appropriate SwiftUI controls, but focus on clarity and usability rather than decoration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may continue refining the visual design outside class.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remember: The agent can implement your decisions, but <strong>you are responsible for deciding what information matters, how it is presented, and how users interact with it.<\/strong>  Also, consider when making a change yourself might be quicker \u2014 <em>and use less of your account tokens<\/em> \u2014 than asking the agent.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Save your work. We will use it as the starting point for part two.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve built data-driven apps that use arrays and objects to store information for display. Now we&#8217;re going to work with an app that allows users to interact with, change, and create their own information using a database. Goals We&#8217;ll explore four ideas: Project Brief \/ Specification You&#8217;ll work with an existing native iOS application for &hellip; <a href=\"https:\/\/nmi.cool\/appdev\/homework-12-working-with-data-part-one-a-coffee-shop-journal\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Homework 12: Working with Data, Part One \u2013 A Coffee Shop Journal<\/span><\/a><\/p>\n","protected":false},"author":20,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4388","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/pages\/4388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/comments?post=4388"}],"version-history":[{"count":11,"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/pages\/4388\/revisions"}],"predecessor-version":[{"id":4420,"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/pages\/4388\/revisions\/4420"}],"wp:attachment":[{"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/media?parent=4388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}