{"id":2564,"date":"2022-05-02T21:35:00","date_gmt":"2022-05-03T01:35:00","guid":{"rendered":"https:\/\/michaelrowe01.com\/?p=2564"},"modified":"2022-12-15T06:45:57","modified_gmt":"2022-12-15T11:45:57","slug":"day-2-100-days-of-swift","status":"publish","type":"post","link":"https:\/\/michaelrowe01.com\/index.php\/blog\/day-2-100-days-of-swift\/","title":{"rendered":"Day 2 &#8211; 100 Days of Swift"},"content":{"rendered":"\n<p>Wow!  I&#8217;ve been using swift for a bunch of years, and have never come across enum associations.  Imaging getting to that on day two of a course.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import UIKit\n\nenum Activity {\n    case bored\n    case running(destination: String)\n    case talking(topic: String)\n    case singing(volume: Int)\n}\n\nlet talking = Activity.talking(topic: \"football\")<\/code><\/pre>\n\n\n\n<p>What you see above is the association added to the running, talking and singing values of the enum Activity.  This way you can &#8220;associate&#8221; additional information to a specific enum, making it much more meaningful.  Very cool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wow! I&#8217;ve been using swift for a bunch of years, and have never come across enum associations. Imaging getting to that on day two of a course. What you see above is the association added to the running, talking and singing values of the enum Activity. This way you can &#8220;associate&#8221; additional information to a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_wp_convertkit_post_meta":{"form":"-1","landing_page":"0","tag":"0","restrict_content":"0"},"hide_page_title":"","footnotes":""},"categories":[2],"tags":[632,379],"class_list":["post-2564","post","type-post","status-publish","format-standard","hentry","category-blog","tag-100-days-of-swift","tag-swift"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/2564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/comments?post=2564"}],"version-history":[{"count":1,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/2564\/revisions"}],"predecessor-version":[{"id":2565,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/2564\/revisions\/2565"}],"wp:attachment":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/media?parent=2564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/categories?post=2564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/tags?post=2564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}