{"id":3122,"date":"2020-11-09T20:36:15","date_gmt":"2020-11-09T20:36:15","guid":{"rendered":"http:\/\/4310.mynmi.net\/?page_id=3122"},"modified":"2026-03-21T22:01:21","modified_gmt":"2026-03-21T22:01:21","slug":"three-or-more-in-one","status":"publish","type":"page","link":"https:\/\/nmi.cool\/appdev\/three-or-more-in-one\/","title":{"rendered":"Homework 13: Three (or more) in one"},"content":{"rendered":"\n<p>This week&#8217;s assignment covers three chapters from your recent textbook reading. You&#8217;ll build all three exercises inside a single Xcode project, with a link in <code>ContentView<\/code> to each part.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Get Started<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Create a new SwiftUI project named <strong>week12<\/strong>.<\/li>\n<li>In <code>ContentView<\/code>, add navigation links to three separate views \u2014 one for each part below. Create those files now so you have somewhere to work.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Part 1: Navigation Bar Customization<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Create a new SwiftUI file named <strong>listStyle<\/strong> and link to it from <code>ContentView<\/code>.<\/li>\n<li>Add a list to <code>listStyle<\/code>. You can use any list you like \u2014 including one you&#8217;ve built before \u2014 but don&#8217;t use the exact list from the textbook.<\/li>\n<li>Find the section titled <em>Configuring Font and Color<\/em> in Chapter 11.<\/li>\n<li>Add a <strong>NavigationBar title<\/strong> and customize it dramatically. Don&#8217;t just copy the book&#8217;s code \u2014 make yours look clearly different from the example.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Part 2: Back Button Customization<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Link each item in your list to some destination view. Keep the destination simple \u2014 the point here is the back button, not the content.<\/li>\n<li>Find the section titled <em>Back Button Image and Color<\/em> in Chapter 11.<\/li>\n<li>Customize the back button by changing both its <strong>image<\/strong> and <strong>color<\/strong>. The book uses SF Symbols, but feel free to swap in your own image instead.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Part 3: Modal Views<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Create a new SwiftUI view with a list. You can reuse the same list from Part 1.<\/li>\n<li>Follow the instructions in Chapter 12 to create a <strong>modal view<\/strong> that appears when a list row is tapped.<\/li>\n<li>The modal view must include a <strong>floating dismiss button<\/strong>. You can borrow this approach directly from the textbook.<\/li>\n<li>Add an <strong>alert<\/strong> that appears when the floating button is tapped.<\/li>\n<li>Important: when the book says to &#8220;attach the alert modifier to the ScrollView,&#8221; place the <code>.alert<\/code> modifier <em>inside<\/em> the <code>ScrollView<\/code> at the bottom \u2014 not outside it.<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This week&#8217;s assignment covers three chapters from your recent textbook reading. You&#8217;ll build all three exercises inside a single Xcode project, with a link in ContentView to each part. Get Started Part 1: Navigation Bar Customization Part 2: Back Button Customization Part 3: Modal Views<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3122","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/pages\/3122","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/comments?post=3122"}],"version-history":[{"count":6,"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/pages\/3122\/revisions"}],"predecessor-version":[{"id":4153,"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/pages\/3122\/revisions\/4153"}],"wp:attachment":[{"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/media?parent=3122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}