{"id":2736,"date":"2020-02-10T00:28:37","date_gmt":"2020-02-10T00:28:37","guid":{"rendered":"http:\/\/4310.mynmi.net\/?page_id=2736"},"modified":"2026-03-21T22:01:24","modified_gmt":"2026-03-21T22:01:24","slug":"path-and-shape-chapter-8","status":"publish","type":"page","link":"https:\/\/nmi.cool\/appdev\/path-and-shape-chapter-8\/","title":{"rendered":"Path and Shape (Chapter 8)"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p>This chapter is all about shapes and will ultimately show you how to build a cool pie chart. It is easy to imagine using the procedures covered in this chapter to create all kinds of dynamic shapes and colors based on user input.<\/p>\n\n\n\n<p>This is one of the longer chapters in the book and includes 52 pages of exercises about shapes, which can get kind of tedious. Give yourself some extra time to follow along and don&#8217;t hesitate to take some breaks and come back to it!<\/p>\n\n\n\n<p><strong>Read Chapter 8: Implementing Path and Shape for Line Drawing and Pie Charts<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Key Takeaways<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><code>Path<\/code> lets you draw arbitrary vector shapes using move, line, and arc commands \u2014 conceptually similar to the HTML Canvas 2D API.<\/li>\n\n\n<li>The <code>Shape<\/code> protocol wraps a <code>Path<\/code> in a reusable, auto-resizable view that plugs into the normal SwiftUI layout system.<\/li>\n\n\n<li>Pie chart slices are arcs on a shared coordinate system, each starting where the previous one ended \u2014 the angles are calculated from your data values.<\/li>\n\n\n<li>A <code>ZStack<\/code> layers individual slice views to assemble the full chart.<\/li>\n\n\n<li>This is one of the longer chapters \u2014 budget extra time and work through every exercise; the pie chart is a milestone project you&#8217;ll build on in Homework 7.<\/li>\n\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Overview This chapter is all about shapes and will ultimately show you how to build a cool pie chart. It is easy to imagine using the procedures covered in this chapter to create all kinds of dynamic shapes and colors based on user input. This is one of the longer chapters in the book and &hellip; <a href=\"https:\/\/nmi.cool\/appdev\/path-and-shape-chapter-8\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Path and Shape (Chapter 8)<\/span><\/a><\/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-2736","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/pages\/2736","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=2736"}],"version-history":[{"count":4,"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/pages\/2736\/revisions"}],"predecessor-version":[{"id":4168,"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/pages\/2736\/revisions\/4168"}],"wp:attachment":[{"href":"https:\/\/nmi.cool\/appdev\/wp-json\/wp\/v2\/media?parent=2736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}