<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Type Safely]]></title><description><![CDATA[SwiftUI tutorials every day]]></description><link>https://www.typesafely.co.uk</link><image><url>https://substackcdn.com/image/fetch/$s_!BWad!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png</url><title>Type Safely</title><link>https://www.typesafely.co.uk</link></image><generator>Substack</generator><lastBuildDate>Thu, 30 Apr 2026 13:40:35 GMT</lastBuildDate><atom:link href="https://www.typesafely.co.uk/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Type Safely]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[typesafely@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[typesafely@substack.com]]></itunes:email><itunes:name><![CDATA[Type Safely]]></itunes:name></itunes:owner><itunes:author><![CDATA[Type Safely]]></itunes:author><googleplay:owner><![CDATA[typesafely@substack.com]]></googleplay:owner><googleplay:email><![CDATA[typesafely@substack.com]]></googleplay:email><googleplay:author><![CDATA[Type Safely]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Make Your Existing Project Run On Vision Pro]]></title><description><![CDATA[Daily Coding Tip 292]]></description><link>https://www.typesafely.co.uk/p/make-your-existing-project-run-on</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/make-your-existing-project-run-on</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Tue, 04 Jul 2023 22:48:15 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="5424" height="3528" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3528,&quot;width&quot;:5424,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;shallow focus photography of pink, orange, and green snow goggle&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="shallow focus photography of pink, orange, and green snow goggle" title="shallow focus photography of pink, orange, and green snow goggle" srcset="https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1513908512605-c58d3f08079f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw3fHxza2klMjBnb2dnbGVzfGVufDB8fHx8MTY4ODUxMDc3MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@mattyfours">Matthew Fournier</a> on <a href="https://unsplash.com/@mattyfours">Unsplash</a></figcaption></figure></div><p>Turning any project existing project into a Vision Pro app is as simple as adding Vision Pro to the Supported Destinations in your project&#8217;s settings:</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/make-your-existing-project-run-on">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Use .matchedGeometryEffect To View Items In a LazyVGrid]]></title><description><![CDATA[Daily Coding Tip 291]]></description><link>https://www.typesafely.co.uk/p/use-matchedgeometryeffect-to-view</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/use-matchedgeometryeffect-to-view</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Mon, 03 Jul 2023 22:09:00 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="5472" height="3648" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3648,&quot;width&quot;:5472,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;photo of corrugated sheets&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="photo of corrugated sheets" title="photo of corrugated sheets" srcset="https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1527148191484-193c02d12e83?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwzMnx8Z3JpZHxlbnwwfHx8fDE2ODg0MjY1ODJ8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@adrian_trinkaus">Adrian Trinkaus</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure></div><p>The <code>.matchedGeometryEffect() </code>modifier makes it possible to identify multiple views as the same view, regardless of whether they are in the same place in the view hierarchy. This is useful because you can animate a view as it changes place in the view hierarchy. The parent hierarchy is given a <code>@Namespace</code> and this can be passed to the modifier.</p><p>When using the modifier inside the animated views it is necessary to pass the namespace as a property so that it is accessible locally.</p><p>I am creating a grid of squares called <code>AdaptiveView</code> that each display their index from 0 to 99. That means that they need to be given that index, and they need to be able to alter the currently selected index. This is because each one can be tapped once to bring it into focus and again to remove it from focus.</p><p>This selectedIndex value will start as -1, which is an invalid index. This is the state where the entire grid will be shown, while tapping an <code>AdaptiveView</code> will change the <code>selectedIndex</code> to the index for that view.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fn0H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dea6274-d9ab-47cd-a0c0-658407437401_1847x1694.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fn0H!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dea6274-d9ab-47cd-a0c0-658407437401_1847x1694.png 424w, https://substackcdn.com/image/fetch/$s_!fn0H!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dea6274-d9ab-47cd-a0c0-658407437401_1847x1694.png 848w, https://substackcdn.com/image/fetch/$s_!fn0H!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dea6274-d9ab-47cd-a0c0-658407437401_1847x1694.png 1272w, https://substackcdn.com/image/fetch/$s_!fn0H!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dea6274-d9ab-47cd-a0c0-658407437401_1847x1694.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fn0H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dea6274-d9ab-47cd-a0c0-658407437401_1847x1694.png" width="1456" height="1335" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8dea6274-d9ab-47cd-a0c0-658407437401_1847x1694.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1335,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:265848,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fn0H!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dea6274-d9ab-47cd-a0c0-658407437401_1847x1694.png 424w, https://substackcdn.com/image/fetch/$s_!fn0H!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dea6274-d9ab-47cd-a0c0-658407437401_1847x1694.png 848w, https://substackcdn.com/image/fetch/$s_!fn0H!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dea6274-d9ab-47cd-a0c0-658407437401_1847x1694.png 1272w, https://substackcdn.com/image/fetch/$s_!fn0H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8dea6274-d9ab-47cd-a0c0-658407437401_1847x1694.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong><a href="https://gist.github.com/sturdysturge/de94fe9cbc01e62483a5f680248c2aeb">AdaptiveView.swift</a></strong></figcaption></figure></div><p>The colours are a rainbow that changes based on the index. The first 7 will use each of the colours in the array, and the 8th <code>AdaptiveView</code> will then be red and each successive view will cycle through the colours one by one indefinitely.</p><p>Now I want to create the grid.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!df9A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f53e4d-0efb-4e02-9533-3a6f6807c991_2020x1442.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!df9A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f53e4d-0efb-4e02-9533-3a6f6807c991_2020x1442.png 424w, https://substackcdn.com/image/fetch/$s_!df9A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f53e4d-0efb-4e02-9533-3a6f6807c991_2020x1442.png 848w, https://substackcdn.com/image/fetch/$s_!df9A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f53e4d-0efb-4e02-9533-3a6f6807c991_2020x1442.png 1272w, https://substackcdn.com/image/fetch/$s_!df9A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f53e4d-0efb-4e02-9533-3a6f6807c991_2020x1442.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!df9A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f53e4d-0efb-4e02-9533-3a6f6807c991_2020x1442.png" width="1456" height="1039" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/23f53e4d-0efb-4e02-9533-3a6f6807c991_2020x1442.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1039,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:221737,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!df9A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f53e4d-0efb-4e02-9533-3a6f6807c991_2020x1442.png 424w, https://substackcdn.com/image/fetch/$s_!df9A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f53e4d-0efb-4e02-9533-3a6f6807c991_2020x1442.png 848w, https://substackcdn.com/image/fetch/$s_!df9A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f53e4d-0efb-4e02-9533-3a6f6807c991_2020x1442.png 1272w, https://substackcdn.com/image/fetch/$s_!df9A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f53e4d-0efb-4e02-9533-3a6f6807c991_2020x1442.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong><a href="https://gist.github.com/sturdysturge/dcfe8924a5356f9807e97956775af5d8">GridViewerContentView.swift</a></strong></figcaption></figure></div><p>You may notice that each <code>AdaptiveView</code> is only shown in the grid only when it isn&#8217;t currently selected. </p><p>Otherwise a <code>Rectangle</code> will be shown, which is the primary font colour by default. In Light Mode this will be black, while in Dark Mode it will be white. The important thing is that it won&#8217;t be an <code>AdaptiveView</code>, and the only place an <code>AdaptiveView</code> with the same index will appear is in front of the grid as part of the <code>ZStack</code> layout. As the view in the grid is set as the source of the animation, there is no conflict in situations where both views are rendered temporarily.</p><p>Here&#8217;s how it should look:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8gjy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e55e7c4-5da1-4ee8-b186-071a28d71ba5_296x640.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8gjy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e55e7c4-5da1-4ee8-b186-071a28d71ba5_296x640.gif 424w, https://substackcdn.com/image/fetch/$s_!8gjy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e55e7c4-5da1-4ee8-b186-071a28d71ba5_296x640.gif 848w, https://substackcdn.com/image/fetch/$s_!8gjy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e55e7c4-5da1-4ee8-b186-071a28d71ba5_296x640.gif 1272w, https://substackcdn.com/image/fetch/$s_!8gjy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e55e7c4-5da1-4ee8-b186-071a28d71ba5_296x640.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8gjy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e55e7c4-5da1-4ee8-b186-071a28d71ba5_296x640.gif" width="320" height="691.8918918918919" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7e55e7c4-5da1-4ee8-b186-071a28d71ba5_296x640.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:640,&quot;width&quot;:296,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:642753,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8gjy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e55e7c4-5da1-4ee8-b186-071a28d71ba5_296x640.gif 424w, https://substackcdn.com/image/fetch/$s_!8gjy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e55e7c4-5da1-4ee8-b186-071a28d71ba5_296x640.gif 848w, https://substackcdn.com/image/fetch/$s_!8gjy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e55e7c4-5da1-4ee8-b186-071a28d71ba5_296x640.gif 1272w, https://substackcdn.com/image/fetch/$s_!8gjy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e55e7c4-5da1-4ee8-b186-071a28d71ba5_296x640.gif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p>]]></content:encoded></item><item><title><![CDATA[How To Initialise a View's Body Property With a Switch (and Why You Probably Shouldn't)]]></title><description><![CDATA[Daily Coding Tip 290]]></description><link>https://www.typesafely.co.uk/p/how-to-initialise-a-views-body-property</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/how-to-initialise-a-views-body-property</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Sun, 18 Jun 2023 13:37:22 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="4044" height="3372" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3372,&quot;width&quot;:4044,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;window curtain open wide&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="window curtain open wide" title="window curtain open wide" srcset="https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1509644851169-2acc08aa25b5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHx3aW5kb3d8ZW58MHx8fHwxNjg3MDk0NjE5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@robwingate">Rob Wingate</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure></div><pre><code>Last tested on Xcode 15 beta 1</code></pre><p>After <a href="https://www.typesafely.co.uk/p/use-a-switch-to-create-a-value-inside">my previous Daily Coding Tip</a>, I was interested to know what the limitations of assigning a value to a property or variable.</p><p>The <code>body</code> in a SwiftUI view is usually a computed property, meaning it&#8217;s kinda like a function that returns the opaque type <code>some View</code>. If you know it&#8217;ll be the same &#8230;</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/how-to-initialise-a-views-body-property">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Use a Switch To Create a Value Inside a SwiftUI View's Body Property]]></title><description><![CDATA[Daily Coding Tip 289]]></description><link>https://www.typesafely.co.uk/p/use-a-switch-to-create-a-value-inside</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/use-a-switch-to-create-a-value-inside</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Fri, 16 Jun 2023 23:44:17 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="6000" height="4000" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4000,&quot;width&quot;:6000,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;grey metal railway during daytime&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="grey metal railway during daytime" title="grey metal railway during daytime" srcset="https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1563633489265-cc7801a76822?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwyfHxyYWlsd2F5JTIwc3dpdGNofGVufDB8fHx8MTY4Njk1ODEwMHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@causeimluap">Paul</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure></div><p>It&#8217;s now possible to use if statements and switches wherever you are assigning a value.</p><p>Unfortunately (or perhaps fortunately) this does not work when passing a parameter, for instance to create the <code>StringProtocol</code> inside the initialiser for a <code>Text</code> view. </p><p>But since I can create local variables inside the view&#8217;s <code>body</code> property anyway&#8230;</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/use-a-switch-to-create-a-value-inside">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Set The Size and Type of #Preview With PreviewTrait]]></title><description><![CDATA[Daily Coding Tip 288]]></description><link>https://www.typesafely.co.uk/p/set-the-size-and-type-of-preview</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/set-the-size-and-type-of-preview</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Wed, 14 Jun 2023 22:55:59 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="6000" height="4000" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4000,&quot;width&quot;:6000,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;white and blue collage photo frame&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="white and blue collage photo frame" title="white and blue collage photo frame" srcset="https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1549716679-95380658d5cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxNnx8Y2FudmFzfGVufDB8fHx8MTY4Njc2NjY3NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@honeypoppet">Sandie Clarke</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure></div><pre><code><code>Last Tested on Xcode 15.0 beta 1</code></code></pre><p>When creating a Preview with the new iOS 17 <code>#Preview</code> macro, there is firstly an optional <code>name</code>. As with any optional that has a default value of <code>nil</code>, not adding anything is equivalent to passing <code>nil</code>. The default name that is displayed when a Preview has no name is unsurprisingly <em>Preview</em>.</p><p>Th&#8230;</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/set-the-size-and-type-of-preview">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Animate The New Pie Chart With Data You Can Add At Runtime]]></title><description><![CDATA[Daily Coding Tip 287]]></description><link>https://www.typesafely.co.uk/p/animate-the-new-pie-chart-with-data</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/animate-the-new-pie-chart-with-data</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Wed, 14 Jun 2023 17:15:55 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="6000" height="4000" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4000,&quot;width&quot;:6000,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;pie on white ceramic plate&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="pie on white ceramic plate" title="pie on white ceramic plate" srcset="https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1562007908-859b4ba9a1a2?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHw0fHxwaWUlMjBjaGFydHxlbnwwfHx8fDE2ODY3NTg1NDl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@dilja96">Diliara Garifullina</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure></div><pre><code>Last Tested on Xcode 15.0 beta 1</code></pre><p>There are a number of new additions to the Charts framework, and one of them is the ability to create pie charts. This is done using <code>SectorMark</code>, as shown below. I am first creating an <code>Item</code> that will represent a single data point with a <code>title</code> and <code>amount</code>. I have made it Identifiable s&#8230;</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/animate-the-new-pie-chart-with-data">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Using The New @Observable Instead of Inheriting From ObservableObject]]></title><description><![CDATA[Daily Coding Tip 286]]></description><link>https://www.typesafely.co.uk/p/using-the-new-observable-instead</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/using-the-new-observable-instead</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Mon, 12 Jun 2023 22:08:20 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="720" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;woman using gray building binoculars&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="woman using gray building binoculars" title="woman using gray building binoculars" srcset="https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1483919283443-8db97e2bcd81?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wzMDAzMzh8MHwxfHNlYXJjaHwxfHxvYnNlcnZlfGVufDB8fHx8MTY4NjYwNjQwNHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@freddymarschall">Frederick Marschall</a> on <a href="https://unsplash.com/">Unplash</a></figcaption></figure></div><p>When I saw <code>@Observable</code> in the <a href="https://developer.apple.com/videos/play/wwdc2023/102/">Platforms State of the Union</a> on day 1 of WWDC, I rushed to make a tutorial that would make use of it. Instead of a model class inheriting from <code>ObservableObject</code> and marking its properties as <code>@Published</code>, we can now simply mark the model class as <code>@Observable</code>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oFpb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b95139-99f8-47fd-be9f-c6d027052410_903x602.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oFpb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b95139-99f8-47fd-be9f-c6d027052410_903x602.png 424w, https://substackcdn.com/image/fetch/$s_!oFpb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b95139-99f8-47fd-be9f-c6d027052410_903x602.png 848w, https://substackcdn.com/image/fetch/$s_!oFpb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b95139-99f8-47fd-be9f-c6d027052410_903x602.png 1272w, https://substackcdn.com/image/fetch/$s_!oFpb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b95139-99f8-47fd-be9f-c6d027052410_903x602.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oFpb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b95139-99f8-47fd-be9f-c6d027052410_903x602.png" width="903" height="602" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/33b95139-99f8-47fd-be9f-c6d027052410_903x602.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:602,&quot;width&quot;:903,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:59284,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oFpb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b95139-99f8-47fd-be9f-c6d027052410_903x602.png 424w, https://substackcdn.com/image/fetch/$s_!oFpb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b95139-99f8-47fd-be9f-c6d027052410_903x602.png 848w, https://substackcdn.com/image/fetch/$s_!oFpb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b95139-99f8-47fd-be9f-c6d027052410_903x602.png 1272w, https://substackcdn.com/image/fetch/$s_!oFpb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b95139-99f8-47fd-be9f-c6d027052410_903x602.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong><a href="https://gist.github.com/sturdysturge/b1a796216bfba0fad26e154d6dd4c7e8">ObservableViewModel.swift</a></strong></figcaption></figure></div><p>It was necessary to <code>import SwiftData</code>, which is a new framework that makes it easier to save data persistently. I won&#8217;t be doing that, but it isn&#8217;t possible to use <code>@Observable</code> if I don&#8217;t import it. I also have to <code>import</code> <code>Foundation</code> in order to access Double, which I&#8217;m using to store the width of a <code>Rectangle</code> in my view.</p><p>I couldn&#8217;t figure this tutorial out a week ago because <code>@Observable</code> isn&#8217;t compatible with <code>@ObservedObject</code>. This is what was previously used to access a model class that inherits from <code>ObservableObject</code>, and code such as <code>$model.width</code> can be used to access the <code>@Published</code> properties within that class.</p><p>Doing that now will cause an error.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!n_iM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42881015-dbb0-4d22-948b-94c72828d39a_1519x896.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!n_iM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42881015-dbb0-4d22-948b-94c72828d39a_1519x896.png 424w, https://substackcdn.com/image/fetch/$s_!n_iM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42881015-dbb0-4d22-948b-94c72828d39a_1519x896.png 848w, https://substackcdn.com/image/fetch/$s_!n_iM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42881015-dbb0-4d22-948b-94c72828d39a_1519x896.png 1272w, https://substackcdn.com/image/fetch/$s_!n_iM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42881015-dbb0-4d22-948b-94c72828d39a_1519x896.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!n_iM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42881015-dbb0-4d22-948b-94c72828d39a_1519x896.png" width="1456" height="859" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/42881015-dbb0-4d22-948b-94c72828d39a_1519x896.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:859,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:117677,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!n_iM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42881015-dbb0-4d22-948b-94c72828d39a_1519x896.png 424w, https://substackcdn.com/image/fetch/$s_!n_iM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42881015-dbb0-4d22-948b-94c72828d39a_1519x896.png 848w, https://substackcdn.com/image/fetch/$s_!n_iM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42881015-dbb0-4d22-948b-94c72828d39a_1519x896.png 1272w, https://substackcdn.com/image/fetch/$s_!n_iM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42881015-dbb0-4d22-948b-94c72828d39a_1519x896.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong><a href="https://gist.github.com/sturdysturge/7fb96bc447f3a59e7cea684f2461365f">ObservableContentView.swift</a></strong></figcaption></figure></div><p>Now we can actually use <code>@State</code> for the model, which was previously only used for local properties inside the <code>ContentView</code>. </p><p>This is also the first time I&#8217;ve used<code> #Preview</code>, which is a far easier way to show what you want in the SwiftUI Preview Canvas.</p>]]></content:encoded></item><item><title><![CDATA[Print To a Floating Popover With LocalConsole]]></title><description><![CDATA[Daily Coding Tip 285]]></description><link>https://www.typesafely.co.uk/p/print-to-a-floating-popover-with</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/print-to-a-floating-popover-with</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Mon, 08 May 2023 21:00:53 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="720" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;white and gray hp all in one printer&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="white and gray hp all in one printer" title="white and gray hp all in one printer" srcset="https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1612815154858-60aa4c59eaa6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxwcmludGVyfGVufDB8fHx8MTY4MzAzODA0Nw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@mahrous_houses">Mahrous Houses</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>It&#8217;s difficult to print to the console using SwiftUI Previews.</p><p>There is a tab on the console called Previews, but for me it only seems to work when I run the previews on a physical device. When I&#8217;m working on the Live Preview inside Xcode, I still want to be able to print values to a console. </p><p>I&#8217;m going to be making use of <em>LocalConsole</em>, so make sure you go to <em>File &gt; Add Packages&#8230;</em> and paste the following into the search box in the top right:</p><pre><code>https://github.com/duraidabdul/LocalConsole</code></pre><p>Once you&#8217;ve added the package to your project, you should be able to import it into any file.</p><p><em>LocalConsole</em> displays a little console that can be dragged to one of the corners of the screen or resized, making it great for situations when the Xcode debugger isn&#8217;t connected.</p><p>I&#8217;m going to start by determining whether the app is running on Xcode&#8217;s SwiftUI Previews. It&#8217;s possible to check for an environment variable called <code>XCODE_RUNNING_FOR_PREVIEWS</code>, but this would still include SwiftUI Previews being run on a physical device. This is notably different from when the app is built and run on a Simulator, as that does not involve SwiftUI Previews at all. </p><p>I&#8217;m determining whether a Simulator is being used, and when it isn&#8217;t, I am returning false.</p><p>If you don&#8217;t mind LocalConsole running on a device, simply remove all lines beginning with the <code>#</code> symbol as well as the <code>return false</code> line.</p><p>Next I have my own version of the <code>print</code> function. </p><p>Usually it&#8217;s possible to shadow the default print function, meaning you can create a custom version of it at global scope that effectively overrides the default implementation. Unfortunately this approach does not work with SwiftUI Previews as it seems to cause an error.</p><p>Instead I removed the terminator parameter from the function, which changes the function signature enough so that it is no longer shadowing.</p><p>I&#8217;ve made it easier to access the shared instance of LocalConsole&#8217;s manager too.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9e55!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb75fe8f-f8e4-4fd4-9449-b81fa002ea29_1165x1194.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9e55!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb75fe8f-f8e4-4fd4-9449-b81fa002ea29_1165x1194.png 424w, https://substackcdn.com/image/fetch/$s_!9e55!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb75fe8f-f8e4-4fd4-9449-b81fa002ea29_1165x1194.png 848w, https://substackcdn.com/image/fetch/$s_!9e55!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb75fe8f-f8e4-4fd4-9449-b81fa002ea29_1165x1194.png 1272w, https://substackcdn.com/image/fetch/$s_!9e55!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb75fe8f-f8e4-4fd4-9449-b81fa002ea29_1165x1194.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9e55!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb75fe8f-f8e4-4fd4-9449-b81fa002ea29_1165x1194.png" width="1165" height="1194" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eb75fe8f-f8e4-4fd4-9449-b81fa002ea29_1165x1194.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1194,&quot;width&quot;:1165,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:179048,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9e55!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb75fe8f-f8e4-4fd4-9449-b81fa002ea29_1165x1194.png 424w, https://substackcdn.com/image/fetch/$s_!9e55!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb75fe8f-f8e4-4fd4-9449-b81fa002ea29_1165x1194.png 848w, https://substackcdn.com/image/fetch/$s_!9e55!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb75fe8f-f8e4-4fd4-9449-b81fa002ea29_1165x1194.png 1272w, https://substackcdn.com/image/fetch/$s_!9e55!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb75fe8f-f8e4-4fd4-9449-b81fa002ea29_1165x1194.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong><a href="https://gist.github.com/sturdysturge/5bd8a5bfcaa103bfeb8bc8245ea02cee">ConsoleGlobals.swift</a></strong></figcaption></figure></div><p>Now I can create my user interface. I am going to be printing whatever is entered into a <code>TextField</code> when a <code>Button</code> is pressed. Usually I use <code>Form</code>, but that presents a problem with the default way <em>LocalConsole </em>is displayed in the top corner means it would cover up the content. </p><p>Instead I&#8217;m using a simple <code>VStack</code> that will centre the content.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KvNR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba4c0dd7-5cbd-4d81-98af-961b4806400f_1165x904.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KvNR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba4c0dd7-5cbd-4d81-98af-961b4806400f_1165x904.png 424w, https://substackcdn.com/image/fetch/$s_!KvNR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba4c0dd7-5cbd-4d81-98af-961b4806400f_1165x904.png 848w, https://substackcdn.com/image/fetch/$s_!KvNR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba4c0dd7-5cbd-4d81-98af-961b4806400f_1165x904.png 1272w, https://substackcdn.com/image/fetch/$s_!KvNR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba4c0dd7-5cbd-4d81-98af-961b4806400f_1165x904.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KvNR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba4c0dd7-5cbd-4d81-98af-961b4806400f_1165x904.png" width="1165" height="904" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba4c0dd7-5cbd-4d81-98af-961b4806400f_1165x904.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:904,&quot;width&quot;:1165,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:124901,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!KvNR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba4c0dd7-5cbd-4d81-98af-961b4806400f_1165x904.png 424w, https://substackcdn.com/image/fetch/$s_!KvNR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba4c0dd7-5cbd-4d81-98af-961b4806400f_1165x904.png 848w, https://substackcdn.com/image/fetch/$s_!KvNR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba4c0dd7-5cbd-4d81-98af-961b4806400f_1165x904.png 1272w, https://substackcdn.com/image/fetch/$s_!KvNR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba4c0dd7-5cbd-4d81-98af-961b4806400f_1165x904.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong><a href="https://gist.github.com/sturdysturge/b54f0dc8cc527ef5e2d3fc3391033df3">ConsoleContentView.swift</a></strong></figcaption></figure></div><p>The only other thing going on here is I&#8217;m making the console visible, but only when running on SwiftUI Previews. If you want the console to always be visible, you can simply put these lines directly in the <code>onAppear</code> block without using an if statement.</p><h1>Last Week&#8217;s Daily Coding Tips</h1><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;b3fef07e-bdf0-4c32-87f4-9e159eac02d1&quot;,&quot;caption&quot;:&quot;Unix operating systems originally had a system time that was based on a number of seconds since midnight on January 1st 1970. Every Apple operating system has at its core a Unix kernel called Darwin. That&#8217;s why Date().timeIntervalSince1970 exists. Sometimes it&#8217;s useful to be able to convert between Unix time and regular &#8230;&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;lg&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Create a Unix Timestamp to Date Converter With SwiftUI&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22682773,&quot;name&quot;:&quot;Type Safely&quot;,&quot;bio&quot;:&quot;SwiftUI and Swift tips&quot;,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/83c25740-5894-4255-aa34-c49f00c46a18_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2023-05-01T22:07:00.000Z&quot;,&quot;cover_image&quot;:&quot;https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.typesafely.co.uk/p/create-a-unix-timestamp-to-date-converter&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:118581246,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;Type Safely&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;6669c98e-c41a-49c3-a8a4-24dea46c72da&quot;,&quot;caption&quot;:&quot;It&#8217;s pretty easy to access what time zones the system is aware of by accessing TimeZone.knownTimeZoneIdentifiers. It would probably be more useful if it was an array of TimeZone values, since these have identifier as a property but can also be used in a&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;lg&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Make a World Clock App That Converts Between Time Zones&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:22682773,&quot;name&quot;:&quot;Type Safely&quot;,&quot;bio&quot;:&quot;SwiftUI and Swift tips&quot;,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/83c25740-5894-4255-aa34-c49f00c46a18_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2023-05-02T23:44:59.371Z&quot;,&quot;cover_image&quot;:&quot;https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.typesafely.co.uk/p/make-a-world-clock-app-that-converts&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:118757851,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;Type Safely&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div>]]></content:encoded></item><item><title><![CDATA[Make a World Clock App That Converts Between Time Zones]]></title><description><![CDATA[Daily Coding Tip 284]]></description><link>https://www.typesafely.co.uk/p/make-a-world-clock-app-that-converts</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/make-a-world-clock-app-that-converts</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Tue, 02 May 2023 23:44:59 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="609" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:609,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;close-up photography of gray concrete clock towers&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="close-up photography of gray concrete clock towers" title="close-up photography of gray concrete clock towers" srcset="https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1523911994826-b13e77719144?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3fHxsYW5kc2NhcGUlMjBjbG9ja3xlbnwwfHx8fDE2ODMwMjIwOTE&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@chandlerhilken">Chandler Hilken</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>It&#8217;s pretty easy to access what time zones the system is aware of by accessing <code>TimeZone.knownTimeZoneIdentifiers</code>.</p><p>It would probably be more useful if it was an array of <code>TimeZone</code> values, since these have <code>identifier</code> as a property but can also be used in a <code>DateFormatter</code>. The initialiser for <code>TimeZone</code> that takes an identifi&#8230;</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/make-a-world-clock-app-that-converts">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Create a Unix Timestamp to Date Converter With SwiftUI]]></title><description><![CDATA[Daily Coding Tip 283]]></description><link>https://www.typesafely.co.uk/p/create-a-unix-timestamp-to-date-converter</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/create-a-unix-timestamp-to-date-converter</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Mon, 01 May 2023 22:07:00 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="720" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;black and brown analog desk clock&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="black and brown analog desk clock" title="black and brown analog desk clock" srcset="https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1619995743614-5608bea411b3?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHx0aW1lJTIwY2xvY2t8ZW58MHx8fHwxNjgyOTU2NTQx&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@photowolf">Joshua Olsen</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>Unix operating systems originally had a system time that was based on a number of seconds since midnight on January 1st 1970. Every Apple operating system has at its core a Unix kernel called Darwin. That&#8217;s why <code>Date().timeIntervalSince1970</code> exists. </p><p>Sometimes it&#8217;s useful to be able to convert between Unix time and regular time, I&#8217;ve made a converter between the two.</p><p>There&#8217;s a <code>NumberFormatter</code> here that allows me to create a <code>TextField</code> later that can only display integers.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TuLQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f0554a4-cac0-4513-91dd-16861df3e4fd_1030x1324.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TuLQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f0554a4-cac0-4513-91dd-16861df3e4fd_1030x1324.png 424w, https://substackcdn.com/image/fetch/$s_!TuLQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f0554a4-cac0-4513-91dd-16861df3e4fd_1030x1324.png 848w, https://substackcdn.com/image/fetch/$s_!TuLQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f0554a4-cac0-4513-91dd-16861df3e4fd_1030x1324.png 1272w, https://substackcdn.com/image/fetch/$s_!TuLQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f0554a4-cac0-4513-91dd-16861df3e4fd_1030x1324.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TuLQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f0554a4-cac0-4513-91dd-16861df3e4fd_1030x1324.png" width="1030" height="1324" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3f0554a4-cac0-4513-91dd-16861df3e4fd_1030x1324.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1324,&quot;width&quot;:1030,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:210425,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TuLQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f0554a4-cac0-4513-91dd-16861df3e4fd_1030x1324.png 424w, https://substackcdn.com/image/fetch/$s_!TuLQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f0554a4-cac0-4513-91dd-16861df3e4fd_1030x1324.png 848w, https://substackcdn.com/image/fetch/$s_!TuLQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f0554a4-cac0-4513-91dd-16861df3e4fd_1030x1324.png 1272w, https://substackcdn.com/image/fetch/$s_!TuLQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f0554a4-cac0-4513-91dd-16861df3e4fd_1030x1324.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong><a href="https://gist.github.com/sturdysturge/74d1e6c26ffa97ebffe169e654dc8de6">TimestampViewModel.swift</a></strong></figcaption></figure></div><p>There&#8217;s a <code>timeZoneOffsetString</code> that allows me to display the hours that the local time zone is away from UTC, which confusingly stands for Coordinated Universal Time. </p><p>situating-sinologiesThe reason according to the <a href="https://www.nist.gov/pml/time-and-frequency-division/nist-time-frequently-asked-questions-faq#cut">National Institute of Standards and Technology</a>:</p><blockquote><p>In 1970, the Coordinated Universal Time system was devised by an international advisory group of technical experts within the International Telecommunication Union (ITU). The ITU felt it was best to designate a single abbreviation for use in all languages in order to minimize confusion. For example, in English the abbreviation for coordinated universal time would be CUT, while in French the abbreviation for "temps universel coordonn&#233;" would be TUC. To avoid appearing to favor any particular language, the abbreviation UTC was selected.</p></blockquote><p>At the top of my Form is the <code>TextField</code> for the Unix time, sometimes called a timestamp.</p><p>There&#8217;s a <code>DatePicker</code> that is given the<code> .environment(\.timeZone, .gmt)</code> modifier. This changes an environment variable that sets the time zone to <a href="https://en.wikipedia.org/wiki/Greenwich_Mean_Time">Greenwich Mean Time</a>, which is &#8220;the mean solar time at the Royal Observatory in Greenwich, London, counted from midnight&#8221;. This gives an indication of where this time zone is located, but it is now more commonly referred to as the aforementioned UTC.</p><p>Although I am in the UK, this is still not the time currently being observed here.</p><p>The current UK time zone is British Summer Time, which is UTC +1.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cOdA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bccf9c8-8e22-472c-b6db-2787fe7d8fb1_1415x1576.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cOdA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bccf9c8-8e22-472c-b6db-2787fe7d8fb1_1415x1576.png 424w, https://substackcdn.com/image/fetch/$s_!cOdA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bccf9c8-8e22-472c-b6db-2787fe7d8fb1_1415x1576.png 848w, https://substackcdn.com/image/fetch/$s_!cOdA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bccf9c8-8e22-472c-b6db-2787fe7d8fb1_1415x1576.png 1272w, https://substackcdn.com/image/fetch/$s_!cOdA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bccf9c8-8e22-472c-b6db-2787fe7d8fb1_1415x1576.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cOdA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bccf9c8-8e22-472c-b6db-2787fe7d8fb1_1415x1576.png" width="1415" height="1576" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8bccf9c8-8e22-472c-b6db-2787fe7d8fb1_1415x1576.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1576,&quot;width&quot;:1415,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:315811,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cOdA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bccf9c8-8e22-472c-b6db-2787fe7d8fb1_1415x1576.png 424w, https://substackcdn.com/image/fetch/$s_!cOdA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bccf9c8-8e22-472c-b6db-2787fe7d8fb1_1415x1576.png 848w, https://substackcdn.com/image/fetch/$s_!cOdA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bccf9c8-8e22-472c-b6db-2787fe7d8fb1_1415x1576.png 1272w, https://substackcdn.com/image/fetch/$s_!cOdA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8bccf9c8-8e22-472c-b6db-2787fe7d8fb1_1415x1576.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong><a href="https://gist.github.com/sturdysturge/8628a9fcd26e5d6821b14a59a573b767">TimestampContentView.swift</a></strong></figcaption></figure></div><p>I&#8217;ve provided another <code>DatePicker</code> that will display the Unix timestamp as it would be in your time zone. As British Summer Time currently adds an hour to UTC, my <code>DatePicker</code> is only different by one hour. Note that each <code>DatePicker</code> can have the same <code>Binding&lt;Date&gt;</code>, because only the UTC date has the<code> .environment(\.timeZone, .gmt)</code> modifier.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!I6TS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6b9fa14-24a9-47e2-a3d2-c31f6759bfe9_1179x2556.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!I6TS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6b9fa14-24a9-47e2-a3d2-c31f6759bfe9_1179x2556.png 424w, https://substackcdn.com/image/fetch/$s_!I6TS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6b9fa14-24a9-47e2-a3d2-c31f6759bfe9_1179x2556.png 848w, https://substackcdn.com/image/fetch/$s_!I6TS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6b9fa14-24a9-47e2-a3d2-c31f6759bfe9_1179x2556.png 1272w, https://substackcdn.com/image/fetch/$s_!I6TS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6b9fa14-24a9-47e2-a3d2-c31f6759bfe9_1179x2556.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!I6TS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6b9fa14-24a9-47e2-a3d2-c31f6759bfe9_1179x2556.png" width="1179" height="2556" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c6b9fa14-24a9-47e2-a3d2-c31f6759bfe9_1179x2556.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2556,&quot;width&quot;:1179,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:161313,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!I6TS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6b9fa14-24a9-47e2-a3d2-c31f6759bfe9_1179x2556.png 424w, https://substackcdn.com/image/fetch/$s_!I6TS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6b9fa14-24a9-47e2-a3d2-c31f6759bfe9_1179x2556.png 848w, https://substackcdn.com/image/fetch/$s_!I6TS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6b9fa14-24a9-47e2-a3d2-c31f6759bfe9_1179x2556.png 1272w, https://substackcdn.com/image/fetch/$s_!I6TS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6b9fa14-24a9-47e2-a3d2-c31f6759bfe9_1179x2556.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p>]]></content:encoded></item><item><title><![CDATA[Use Any SF Symbol Safely With SFSafeSymbols]]></title><description><![CDATA[Daily Coding Tip 282]]></description><link>https://www.typesafely.co.uk/p/use-any-sf-symbol-safely-with-sfsafesymbols</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/use-any-sf-symbol-safely-with-sfsafesymbols</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Mon, 24 Apr 2023 23:45:10 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="810" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:810,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1553532435-93d532a45f15?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMHx8c3ltYm9sfGVufDB8fHx8MTY4MjM3OTYzNw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@gpthree">George Pagan III</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>Go to <em>File </em>&gt;<em> Add Packages&#8230;</em> and paste the following in the search box in the top right:</p><pre><code>https://github.com/SFSafeSymbols/SFSafeSymbols.git</code></pre><p>Add the package to your project, and you should be able to import the <code>SFSafeSymbols</code> library.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sup7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff82e26f2-d47f-403e-8a61-2e6325067cd8_1107x610.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sup7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff82e26f2-d47f-403e-8a61-2e6325067cd8_1107x610.png 424w, https://substackcdn.com/image/fetch/$s_!sup7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff82e26f2-d47f-403e-8a61-2e6325067cd8_1107x610.png 848w, https://substackcdn.com/image/fetch/$s_!sup7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff82e26f2-d47f-403e-8a61-2e6325067cd8_1107x610.png 1272w, https://substackcdn.com/image/fetch/$s_!sup7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff82e26f2-d47f-403e-8a61-2e6325067cd8_1107x610.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sup7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff82e26f2-d47f-403e-8a61-2e6325067cd8_1107x610.png" width="1107" height="610" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f82e26f2-d47f-403e-8a61-2e6325067cd8_1107x610.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:610,&quot;width&quot;:1107,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:91564,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sup7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff82e26f2-d47f-403e-8a61-2e6325067cd8_1107x610.png 424w, https://substackcdn.com/image/fetch/$s_!sup7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff82e26f2-d47f-403e-8a61-2e6325067cd8_1107x610.png 848w, https://substackcdn.com/image/fetch/$s_!sup7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff82e26f2-d47f-403e-8a61-2e6325067cd8_1107x610.png 1272w, https://substackcdn.com/image/fetch/$s_!sup7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff82e26f2-d47f-403e-8a61-2e6325067cd8_1107x610.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong><a href="https://gist.github.com/sturdysturge/79e44906ced2d6be2d3893249352c87a">SFSafeSymbolsContentView.swift</a></strong></figcaption></figure></div><p>Along with being able to access SF symbols using the constants in the <code>SFSymbol</code> class, there is a new version of <code>Image</code> that takes a <code>systemSymbol</code> parameter instead of a <code>systemName</code> parameter.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Use a Gradient As The Foreground Style of a Text]]></title><description><![CDATA[Daily Coding Tip 281]]></description><link>https://www.typesafely.co.uk/p/use-a-gradient-as-the-foreground</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/use-a-gradient-as-the-foreground</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Fri, 14 Apr 2023 21:35:01 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="720" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1554034483-04fda0d3507b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNHx8Z3JhZGllbnR8ZW58MHx8fHwxNjgxNTA3NjMy&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/es/@adrian_infernus">Adrian Infernus</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>Before iOS 15 there was no <code>.foregroundStyle(_:)</code> modifier, so it was a bit more tricky to use a gradient this way. In iOS 15 and newer versions all we have to do is pass the gradient. This is because <code>LinearGradient</code> conforms to the <code>ShapeStyle</code> protocol as well as the <code>View</code> protocol.</p><p>This is an app that lets you use a <code>TextF&#8230;</code></p>
      <p>
          <a href="https://www.typesafely.co.uk/p/use-a-gradient-as-the-foreground">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Using [unowned self] In a Closure To Reference Self Safely]]></title><description><![CDATA[Daily Coding Tip 280]]></description><link>https://www.typesafely.co.uk/p/using-unowned-self-in-a-closure-to</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/using-unowned-self-in-a-closure-to</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Wed, 12 Apr 2023 23:07:49 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="720" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;person holding DSLR camera&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="person holding DSLR camera" title="person holding DSLR camera" srcset="https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1493733691000-194fcbebfd8e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8Y2FwdHVyZXxlbnwwfHx8fDE2ODEzNDA4MjA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@jamesbold">James Bold</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>When I explored the use of implicit self after unwrapping <code>[weak self]</code> in <a href="https://www.typesafely.co.uk/p/use-implicit-self-after-unwrapping">Daily Coding Tip 276</a>, it was an example of a new Swift 5.8 feature. That feature made it possible to reference functions and properties inside a closure, but only after optional binding occurs.</p><p>With <code>[unowned self]</code>, the reference to <code>self</code> is not optional&#8230;</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/using-unowned-self-in-a-closure-to">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Get a Random Meme From Reddit With Meme API]]></title><description><![CDATA[Daily Coding Tip 279]]></description><link>https://www.typesafely.co.uk/p/get-a-random-meme-from-reddit-with</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/get-a-random-meme-from-reddit-with</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Tue, 11 Apr 2023 23:08:43 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="1440" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1440,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;all you need is lol neon light signage&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="all you need is lol neon light signage" title="all you need is lol neon light signage" srcset="https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1495332711843-da64862d07e7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw3MXx8bWVtZXxlbnwwfHx8fDE2ODEyNTM2MzA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@loklok">Kah Lok Leong</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>This is a simple and free API that doesn&#8217;t require authentication. </p><p>The response contains data about a random Reddit meme from the <a href="https://www.reddit.com/r/memes">r/memes</a>, <a href="https://www.reddit.com/r/dankmemes/">r/dankmemes</a>, and <a href="https://www.reddit.com/r/me_irl/">r/me_irl</a> subreddits. It is possible to get memes from a specific subreddit by adding the name of that subreddit to the end of the URL, but I will just be relying on &#8230;</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/get-a-random-meme-from-reddit-with">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Run Functions Anywhere In The View Body]]></title><description><![CDATA[Daily Coding Tip 278]]></description><link>https://www.typesafely.co.uk/p/run-functions-anywhere-in-the-view</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/run-functions-anywhere-in-the-view</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Tue, 11 Apr 2023 01:00:54 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="810" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:810,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;rose gold Apple Watch&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="rose gold Apple Watch" title="rose gold Apple Watch" srcset="https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1515204230490-1ad00b70ed3d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHw0OXx8cmVmcmVzaHxlbnwwfHx8fDE2ODExNzQ3MDI&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@jessbaileydesigns">Jess Bailey</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p></p><p>In <a href="https://www.typesafely.co.uk/p/see-what-property-change-caused-swiftui">Daily Coding Tip 217</a> I showed how you can use <code>View._printChanges()</code> to print a message in the console whenever the view refreshes.</p><p>This is an undocumented function that always does what Apple created it for: it tells you what property change occurred that resulted in the view being refreshed. There is no option to print any other information, such as what the value of the property that changed (or any other property). </p><p>The fact that the <code>View._printChanges() </code>function is undocumented also means that your App Store submission will be rejected from if you use it.</p><p>Instead of using that I&#8217;m creating my own function that can be put anywhere in the <code>View body</code>, and I can write whatever code I want to run when the view is refreshed there. The function doesn&#8217;t return anything, but in Swift every function that doesn&#8217;t return anything actually returns <code>Void</code>.</p><p>This is important because it explains how I can use it in the following assignment:</p><pre><code>let _ = printRefresh()</code></pre><p>It is now thankfully possible to create local variables inside the <code>body</code>. If I had simply put <code>printRefresh()</code> into the <code>body</code>, I would have got the following error:</p><pre><code>Type '()' cannot conform to 'View'</code></pre><p>In this case <code>() </code>is equivalent to <code>Void</code>, the return type of <code>printRefresh()</code> and every other function in Swift that appears to return nothing. By assigning it to the underscore <code>_</code> I am effectively throwing that function result away and not storing it anywhere, whilst giving myself the ability to run the function that created it.</p><p>This is the same way that the <code>View._printChanges()</code> function was called in <a href="https://www.typesafely.co.uk/p/see-what-property-change-caused-swiftui">Daily Coding Tip 217</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!y09t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd55b4a54-645e-43aa-976a-6037d7e05a72_1589x1072.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!y09t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd55b4a54-645e-43aa-976a-6037d7e05a72_1589x1072.png 424w, https://substackcdn.com/image/fetch/$s_!y09t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd55b4a54-645e-43aa-976a-6037d7e05a72_1589x1072.png 848w, https://substackcdn.com/image/fetch/$s_!y09t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd55b4a54-645e-43aa-976a-6037d7e05a72_1589x1072.png 1272w, https://substackcdn.com/image/fetch/$s_!y09t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd55b4a54-645e-43aa-976a-6037d7e05a72_1589x1072.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!y09t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd55b4a54-645e-43aa-976a-6037d7e05a72_1589x1072.png" width="1456" height="982" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d55b4a54-645e-43aa-976a-6037d7e05a72_1589x1072.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:982,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:178071,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!y09t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd55b4a54-645e-43aa-976a-6037d7e05a72_1589x1072.png 424w, https://substackcdn.com/image/fetch/$s_!y09t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd55b4a54-645e-43aa-976a-6037d7e05a72_1589x1072.png 848w, https://substackcdn.com/image/fetch/$s_!y09t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd55b4a54-645e-43aa-976a-6037d7e05a72_1589x1072.png 1272w, https://substackcdn.com/image/fetch/$s_!y09t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd55b4a54-645e-43aa-976a-6037d7e05a72_1589x1072.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong><a href="https://gist.github.com/sturdysturge/54afb8b2343b7210fd1ebfad2f4b7098">PrintRefreshContentView.swift</a></strong></figcaption></figure></div><p>You might be wondering what&#8217;s going on with <code>viewHasAppeared</code>. </p><p>I originally had my function printing &#8220;view was refreshed&#8221; even when the view was created for the first time, which doesn&#8217;t really seem like a refresh to me. To get around this I make it clear when the view has been created for the first time, which happens before the <code>.onAppear</code> modifier changes <code>viewHasAppeared</code> to <code>true</code>.</p><h1>Last Week&#8217;s Daily Coding Tips</h1><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:112745422,&quot;url&quot;:&quot;https://www.typesafely.co.uk/p/check-for-attribute-availability&quot;,&quot;publication_id&quot;:242083,&quot;publication_name&quot;:&quot;Type Safely&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;title&quot;:&quot;Check For Attribute Availability With hasAttribute&quot;,&quot;truncated_body_text&quot;:&quot;To quote the official Swift.org blog: Swift 5.8 also includes conditional attributes to reduce the maintenance cost of libraries that support multiple Swift tools versions. #if checks can now surround attributes on a declaration, and a new hasAttribute(AttributeName)&quot;,&quot;date&quot;:&quot;2023-04-05T00:56:11.707Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:22682773,&quot;name&quot;:&quot;Type Safely&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/83c25740-5894-4255-aa34-c49f00c46a18_400x400.jpeg&quot;,&quot;bio&quot;:&quot;SwiftUI and Swift tips&quot;,&quot;profile_set_up_at&quot;:&quot;2023-02-18T01:20:07.774Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:18967,&quot;user_id&quot;:22682773,&quot;publication_id&quot;:242083,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:242083,&quot;name&quot;:&quot;Type Safely&quot;,&quot;subdomain&quot;:&quot;typesafely&quot;,&quot;custom_domain&quot;:&quot;www.typesafely.co.uk&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;SwiftUI tutorials every day&quot;,&quot;logo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;author_id&quot;:22682773,&quot;theme_var_background_pop&quot;:&quot;#BAA049&quot;,&quot;created_at&quot;:&quot;2020-12-18T18:17:20.987Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Type Safely&quot;,&quot;copyright&quot;:&quot;Type Safely&quot;,&quot;founding_plan_name&quot;:null,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;type_safely&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.typesafely.co.uk/p/check-for-attribute-availability?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!BWad!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png" loading="lazy"><span class="embedded-post-publication-name">Type Safely</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Check For Attribute Availability With hasAttribute</div></div><div class="embedded-post-body">To quote the official Swift.org blog: Swift 5.8 also includes conditional attributes to reduce the maintenance cost of libraries that support multiple Swift tools versions. #if checks can now surround attributes on a declaration, and a new hasAttribute(AttributeName&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 years ago &#183; Type Safely</div></a></div><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:112794389,&quot;url&quot;:&quot;https://www.typesafely.co.uk/p/safely-add-parameters-to-a-url-using&quot;,&quot;publication_id&quot;:242083,&quot;publication_name&quot;:&quot;Type Safely&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;title&quot;:&quot;Safely Add Parameters To a URL Using URLQueryItem&quot;,&quot;truncated_body_text&quot;:&quot;According to Wikipedia, a query string is &#8220;part of a uniform resource locator (URL) that assigns values to specified parameters&#8221;. It all begins with a question mark at the end of the base URL. After this point you can add as many parameters as you want in the format&quot;,&quot;date&quot;:&quot;2023-04-05T07:23:20.054Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:22682773,&quot;name&quot;:&quot;Type Safely&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/83c25740-5894-4255-aa34-c49f00c46a18_400x400.jpeg&quot;,&quot;bio&quot;:&quot;SwiftUI and Swift tips&quot;,&quot;profile_set_up_at&quot;:&quot;2023-02-18T01:20:07.774Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:18967,&quot;user_id&quot;:22682773,&quot;publication_id&quot;:242083,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:242083,&quot;name&quot;:&quot;Type Safely&quot;,&quot;subdomain&quot;:&quot;typesafely&quot;,&quot;custom_domain&quot;:&quot;www.typesafely.co.uk&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;SwiftUI tutorials every day&quot;,&quot;logo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;author_id&quot;:22682773,&quot;theme_var_background_pop&quot;:&quot;#BAA049&quot;,&quot;created_at&quot;:&quot;2020-12-18T18:17:20.987Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Type Safely&quot;,&quot;copyright&quot;:&quot;Type Safely&quot;,&quot;founding_plan_name&quot;:null,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;type_safely&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.typesafely.co.uk/p/safely-add-parameters-to-a-url-using?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!BWad!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png" loading="lazy"><span class="embedded-post-publication-name">Type Safely</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Safely Add Parameters To a URL Using URLQueryItem</div></div><div class="embedded-post-body">According to Wikipedia, a query string is &#8220;part of a uniform resource locator (URL) that assigns values to specified parameters&#8221;. It all begins with a question mark at the end of the base URL. After this point you can add as many parameters as you want in the format&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 years ago &#183; Type Safely</div></a></div><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:113162426,&quot;url&quot;:&quot;https://www.typesafely.co.uk/p/use-hasfeature-to-determine-whether&quot;,&quot;publication_id&quot;:242083,&quot;publication_name&quot;:&quot;Type Safely&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;title&quot;:&quot;Use hasFeature To Determine Whether Experimental Feature Flags Are Enabled&quot;,&quot;truncated_body_text&quot;:&quot;Start by creating a new Xcode project and going to your project&#8217;s Build Settings. Here you will need to use the search box in the top right to search for Swift flags, and then insert the following value: -Xfrontend -enable-experimental-concise-pound-file&quot;,&quot;date&quot;:&quot;2023-04-06T23:51:06.537Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:22682773,&quot;name&quot;:&quot;Type Safely&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/83c25740-5894-4255-aa34-c49f00c46a18_400x400.jpeg&quot;,&quot;bio&quot;:&quot;SwiftUI and Swift tips&quot;,&quot;profile_set_up_at&quot;:&quot;2023-02-18T01:20:07.774Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:18967,&quot;user_id&quot;:22682773,&quot;publication_id&quot;:242083,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:242083,&quot;name&quot;:&quot;Type Safely&quot;,&quot;subdomain&quot;:&quot;typesafely&quot;,&quot;custom_domain&quot;:&quot;www.typesafely.co.uk&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;SwiftUI tutorials every day&quot;,&quot;logo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;author_id&quot;:22682773,&quot;theme_var_background_pop&quot;:&quot;#BAA049&quot;,&quot;created_at&quot;:&quot;2020-12-18T18:17:20.987Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Type Safely&quot;,&quot;copyright&quot;:&quot;Type Safely&quot;,&quot;founding_plan_name&quot;:null,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;type_safely&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.typesafely.co.uk/p/use-hasfeature-to-determine-whether?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!BWad!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png" loading="lazy"><span class="embedded-post-publication-name">Type Safely</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Use hasFeature To Determine Whether Experimental Feature Flags Are Enabled</div></div><div class="embedded-post-body">Start by creating a new Xcode project and going to your project&#8217;s Build Settings. Here you will need to use the search box in the top right to search for Swift flags, and then insert the following value: -Xfrontend -enable-experimental-concise-pound-file&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 years ago &#183; Type Safely</div></a></div><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:113359907,&quot;url&quot;:&quot;https://www.typesafely.co.uk/p/use-implicit-self-after-unwrapping&quot;,&quot;publication_id&quot;:242083,&quot;publication_name&quot;:&quot;Type Safely&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;title&quot;:&quot;Use Implicit Self After Unwrapping [weak self]&quot;,&quot;truncated_body_text&quot;:&quot;Here&#8217;s another new Swift 5.8 feature. In previous versions of the language, it was still necessary to make capture semantics specific after unwrapping [weak self]. In other words, [weak self] returns an optional version of self that you can unwrap into a non-optional version.&quot;,&quot;date&quot;:&quot;2023-04-07T23:33:51.522Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:22682773,&quot;name&quot;:&quot;Type Safely&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/83c25740-5894-4255-aa34-c49f00c46a18_400x400.jpeg&quot;,&quot;bio&quot;:&quot;SwiftUI and Swift tips&quot;,&quot;profile_set_up_at&quot;:&quot;2023-02-18T01:20:07.774Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:18967,&quot;user_id&quot;:22682773,&quot;publication_id&quot;:242083,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:242083,&quot;name&quot;:&quot;Type Safely&quot;,&quot;subdomain&quot;:&quot;typesafely&quot;,&quot;custom_domain&quot;:&quot;www.typesafely.co.uk&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;SwiftUI tutorials every day&quot;,&quot;logo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;author_id&quot;:22682773,&quot;theme_var_background_pop&quot;:&quot;#BAA049&quot;,&quot;created_at&quot;:&quot;2020-12-18T18:17:20.987Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Type Safely&quot;,&quot;copyright&quot;:&quot;Type Safely&quot;,&quot;founding_plan_name&quot;:null,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;type_safely&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.typesafely.co.uk/p/use-implicit-self-after-unwrapping?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!BWad!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png" loading="lazy"><span class="embedded-post-publication-name">Type Safely</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Use Implicit Self After Unwrapping [weak self]</div></div><div class="embedded-post-body">Here&#8217;s another new Swift 5.8 feature. In previous versions of the language, it was still necessary to make capture semantics specific after unwrapping [weak self]. In other words, [weak self] returns an optional version of self that you can unwrap into a non-optional version&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 years ago &#183; Type Safely</div></a></div><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:113573089,&quot;url&quot;:&quot;https://www.typesafely.co.uk/p/use-property-wrappers-like-state&quot;,&quot;publication_id&quot;:242083,&quot;publication_name&quot;:&quot;Type Safely&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;title&quot;:&quot;Use Property Wrappers Like @State and @Binding Inside The View Body&quot;,&quot;truncated_body_text&quot;:&quot;I am in favour of the Swift evolution proposal Lift all limitations on variables in result builders, which was implemented in Swift 5.8. For too long it has been impossible to do all sorts of things inside a result builder. The @ViewBuilder attribute is an example of a result builder, because it can create a view even if you&#8230;&quot;,&quot;date&quot;:&quot;2023-04-09T01:39:48.278Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:22682773,&quot;name&quot;:&quot;Type Safely&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/83c25740-5894-4255-aa34-c49f00c46a18_400x400.jpeg&quot;,&quot;bio&quot;:&quot;SwiftUI and Swift tips&quot;,&quot;profile_set_up_at&quot;:&quot;2023-02-18T01:20:07.774Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:18967,&quot;user_id&quot;:22682773,&quot;publication_id&quot;:242083,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:242083,&quot;name&quot;:&quot;Type Safely&quot;,&quot;subdomain&quot;:&quot;typesafely&quot;,&quot;custom_domain&quot;:&quot;www.typesafely.co.uk&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;SwiftUI tutorials every day&quot;,&quot;logo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;author_id&quot;:22682773,&quot;theme_var_background_pop&quot;:&quot;#BAA049&quot;,&quot;created_at&quot;:&quot;2020-12-18T18:17:20.987Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Type Safely&quot;,&quot;copyright&quot;:&quot;Type Safely&quot;,&quot;founding_plan_name&quot;:null,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;type_safely&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.typesafely.co.uk/p/use-property-wrappers-like-state?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!BWad!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png" loading="lazy"><span class="embedded-post-publication-name">Type Safely</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Use Property Wrappers Like @State and @Binding Inside The View Body</div></div><div class="embedded-post-body">I am in favour of the Swift evolution proposal Lift all limitations on variables in result builders, which was implemented in Swift 5.8. For too long it has been impossible to do all sorts of things inside a result builder. The @ViewBuilder attribute is an example of a result builder, because it can create a view even if you&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 years ago &#183; Type Safely</div></a></div>]]></content:encoded></item><item><title><![CDATA[Use Property Wrappers Like @State and @Binding Inside The View Body]]></title><description><![CDATA[Daily Coding Tip 277]]></description><link>https://www.typesafely.co.uk/p/use-property-wrappers-like-state</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/use-property-wrappers-like-state</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Sun, 09 Apr 2023 01:39:48 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="720" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;white and black spiral line&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="white and black spiral line" title="white and black spiral line" srcset="https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1626641488286-33dfe6425cb4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxfHxiaW5kaW5nfGVufDB8fHx8MTY4MTAwMzA4Mw&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@danbuckophotography">Dan Bucko</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>I am in favour of the Swift evolution proposal <a href="https://github.com/apple/swift-evolution/blob/main/proposals/0373-vars-without-limits-in-result-builders.md">Lift all limitations on variables in result builders</a>, which was implemented in Swift 5.8.</p><p>For too long it has been impossible to do all sorts of things inside a result builder. The <code>@ViewBuilder</code> attribute is an example of a result builder, because it can create a view even if you&#8230;</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/use-property-wrappers-like-state">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Use Implicit Self After Unwrapping [weak self]]]></title><description><![CDATA[Daily Coding Tip 276]]></description><link>https://www.typesafely.co.uk/p/use-implicit-self-after-unwrapping</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/use-implicit-self-after-unwrapping</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Fri, 07 Apr 2023 23:33:51 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="1080" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1080,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;toddler looking at believe in yourself graffiti&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="toddler looking at believe in yourself graffiti" title="toddler looking at believe in yourself graffiti" srcset="https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1549633030-89d0743bad01?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMXx8c2VsZnxlbnwwfHx8fDE2ODA4OTE5MzY&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@littleforestowl">Katrina Wright</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>Here&#8217;s another new Swift 5.8 feature.</p><p>In previous versions of the language, it was still necessary to make capture semantics specific after unwrapping <code>[weak self]</code>. In other words, [weak self] returns an optional version of self that you can unwrap into a non-optional version. </p><p>When self is no longer optional, it would ma&#8230;</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/use-implicit-self-after-unwrapping">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Use hasFeature To Determine Whether Experimental Feature Flags Are Enabled]]></title><description><![CDATA[Daily Coding Tip 275]]></description><link>https://www.typesafely.co.uk/p/use-hasfeature-to-determine-whether</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/use-hasfeature-to-determine-whether</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Thu, 06 Apr 2023 23:51:06 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="587" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:587,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;red yellow and green flags&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="red yellow and green flags" title="red yellow and green flags" srcset="https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1621977717126-e29965156a27?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyfHxmbGFnc3xlbnwwfHx8fDE2ODA4MjQ5Mzk&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@lemonvlad">Vladislav Klapin</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>Start by creating a new Xcode project and going to your project&#8217;s Build Settings.</p><p>Here you will need to use the search box in the top right to search for Swift flags, and then insert the following value:</p><pre><code>-Xfrontend -enable-experimental-concise-pound-file</code></pre><p>This will enable <a href="https://github.com/apple/swift-evolution/blob/main/proposals/0274-magic-file.md">concise magic file names</a>, a feature that is not y&#8230;</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/use-hasfeature-to-determine-whether">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Safely Add Parameters To a URL Using URLQueryItem]]></title><description><![CDATA[Daily Coding Tip 274]]></description><link>https://www.typesafely.co.uk/p/safely-add-parameters-to-a-url-using</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/safely-add-parameters-to-a-url-using</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Wed, 05 Apr 2023 07:23:20 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="810" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:810,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;brown wooden door with blue number 8 print&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="brown wooden door with blue number 8 print" title="brown wooden door with blue number 8 print" srcset="https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1602516297586-312f705402cb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxNnx8cXVlc3Rpb24lMjBtYXJrfGVufDB8fHx8MTY4MDY3NzQ0NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/fr/@rolls0ut">Jac Alexandru</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>According to Wikipedia, a query string is &#8220;part of a uniform resource locator (URL) that assigns values to specified parameters&#8221;.</p><p>It all begins with a question mark at the end of the base URL. After this point you can add as many parameters as you want in the format <code>name=value</code>, separating each parameter with the <code>&amp;</code> symbol&#8230;</p>
      <p>
          <a href="https://www.typesafely.co.uk/p/safely-add-parameters-to-a-url-using">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Check For Attribute Availability With hasAttribute]]></title><description><![CDATA[Daily Coding Tip 273]]></description><link>https://www.typesafely.co.uk/p/check-for-attribute-availability</link><guid isPermaLink="false">https://www.typesafely.co.uk/p/check-for-attribute-availability</guid><dc:creator><![CDATA[Type Safely]]></dc:creator><pubDate>Wed, 05 Apr 2023 00:56:11 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="720" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;black asus laptop computer showing 3 00&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="black asus laptop computer showing 3 00" title="black asus laptop computer showing 3 00" srcset="https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1584824486509-112e4181ff6b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwyMnx8YXZhaWxhYmxlfGVufDB8fHx8MTY4MDY1NTQ4NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@introspectivedsgn">Erik Mclean</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p>To quote the official Swift.org blog:</p><blockquote><p>Swift 5.8 also includes <em>conditional attributes</em> to reduce the maintenance cost of libraries that support multiple Swift tools versions. <code>#if</code> checks can now surround attributes on a declaration, and a new <code>hasAttribute(AttributeName)</code> conditional directive can be used to check whether the compiler version has support for the attribute with the name <code>AttributeName</code> in the current language mode</p></blockquote><p>As was mentioned in <a href="https://github.com/apple/swift-evolution/blob/main/proposals/0367-conditional-attributes.md">the original Swift Evolution proposal</a>, it can be a bad idea to use <code>#if compiler(&gt;=5.6)</code> to check whether a feature is available. You might get the exact compiler version wrong, and the feature may not have been enabled yet.</p><p>This new method of specifying an attribute eliminates this problem, as the attribute will either be available or not.</p><p>Here&#8217;s an example of using it to check that <code>@dynamicMemberLookup</code> is available.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!drs7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72bf805d-aa09-45ee-9446-77cb5670dca4_1480x1190.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!drs7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72bf805d-aa09-45ee-9446-77cb5670dca4_1480x1190.png 424w, https://substackcdn.com/image/fetch/$s_!drs7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72bf805d-aa09-45ee-9446-77cb5670dca4_1480x1190.png 848w, https://substackcdn.com/image/fetch/$s_!drs7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72bf805d-aa09-45ee-9446-77cb5670dca4_1480x1190.png 1272w, https://substackcdn.com/image/fetch/$s_!drs7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72bf805d-aa09-45ee-9446-77cb5670dca4_1480x1190.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!drs7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72bf805d-aa09-45ee-9446-77cb5670dca4_1480x1190.png" width="1456" height="1171" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/72bf805d-aa09-45ee-9446-77cb5670dca4_1480x1190.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1171,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:162489,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!drs7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72bf805d-aa09-45ee-9446-77cb5670dca4_1480x1190.png 424w, https://substackcdn.com/image/fetch/$s_!drs7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72bf805d-aa09-45ee-9446-77cb5670dca4_1480x1190.png 848w, https://substackcdn.com/image/fetch/$s_!drs7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72bf805d-aa09-45ee-9446-77cb5670dca4_1480x1190.png 1272w, https://substackcdn.com/image/fetch/$s_!drs7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72bf805d-aa09-45ee-9446-77cb5670dca4_1480x1190.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong><a href="https://gist.github.com/sturdysturge/4ee9eadeb0c8f9b37e8a80dcd9de5eb9">HasAttributeContentView.swift</a></strong></figcaption></figure></div><p>When <code>dynamicMemberLookup</code> is unavailable, this type and the view that uses it will not be available.</p><h1>Last Week&#8217;s Daily Coding Tips</h1><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:109861784,&quot;url&quot;:&quot;https://www.typesafely.co.uk/p/add-a-pressed-state-to-a-button-with&quot;,&quot;publication_id&quot;:242083,&quot;publication_name&quot;:&quot;Type Safely&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;title&quot;:&quot;Add a Pressed State To a Button With a Long Press Gesture&quot;,&quot;truncated_body_text&quot;:&quot;Here&#8217;s a simple button that has three states: default, pressed and complete. My definition of &#8216;complete&#8217; here is when the long press gesture has reached its minimum duration. In this case I want to wait 3 seconds before the gesture is complete. In each state I have a colour that I want the button to be. I am using two tr&#8230;&quot;,&quot;date&quot;:&quot;2023-03-21T20:09:36.269Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:22682773,&quot;name&quot;:&quot;Type Safely&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/83c25740-5894-4255-aa34-c49f00c46a18_400x400.jpeg&quot;,&quot;bio&quot;:&quot;SwiftUI and Swift tips&quot;,&quot;profile_set_up_at&quot;:&quot;2023-02-18T01:20:07.774Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:18967,&quot;user_id&quot;:22682773,&quot;publication_id&quot;:242083,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:242083,&quot;name&quot;:&quot;Type Safely&quot;,&quot;subdomain&quot;:&quot;typesafely&quot;,&quot;custom_domain&quot;:&quot;www.typesafely.co.uk&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;SwiftUI tutorials every day&quot;,&quot;logo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;author_id&quot;:22682773,&quot;theme_var_background_pop&quot;:&quot;#BAA049&quot;,&quot;created_at&quot;:&quot;2020-12-18T18:17:20.987Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Type Safely&quot;,&quot;copyright&quot;:&quot;Type Safely&quot;,&quot;founding_plan_name&quot;:null,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;type_safely&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.typesafely.co.uk/p/add-a-pressed-state-to-a-button-with?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!BWad!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png" loading="lazy"><span class="embedded-post-publication-name">Type Safely</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Add a Pressed State To a Button With a Long Press Gesture</div></div><div class="embedded-post-body">Here&#8217;s a simple button that has three states: default, pressed and complete. My definition of &#8216;complete&#8217; here is when the long press gesture has reached its minimum duration. In this case I want to wait 3 seconds before the gesture is complete. In each state I have a colour that I want the button to be. I am using two tr&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 years ago &#183; Type Safely</div></a></div><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:110351266,&quot;url&quot;:&quot;https://www.typesafely.co.uk/p/make-a-random-number-generator-that&quot;,&quot;publication_id&quot;:242083,&quot;publication_name&quot;:&quot;Type Safely&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;title&quot;:&quot;Make a Random Number Generator That Works With Float, Double and Int&quot;,&quot;truncated_body_text&quot;:&quot;I want to be able to generate a random float, double, or integer within a given range. In order to do that, it helps to make NSNumber conform to the Comparable protocol. This makes it possible to decide whether one of these numbers is smaller, which will be useful later.&quot;,&quot;date&quot;:&quot;2023-03-28T00:30:59.214Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:22682773,&quot;name&quot;:&quot;Type Safely&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/83c25740-5894-4255-aa34-c49f00c46a18_400x400.jpeg&quot;,&quot;bio&quot;:&quot;SwiftUI and Swift tips&quot;,&quot;profile_set_up_at&quot;:&quot;2023-02-18T01:20:07.774Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:18967,&quot;user_id&quot;:22682773,&quot;publication_id&quot;:242083,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:242083,&quot;name&quot;:&quot;Type Safely&quot;,&quot;subdomain&quot;:&quot;typesafely&quot;,&quot;custom_domain&quot;:&quot;www.typesafely.co.uk&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;SwiftUI tutorials every day&quot;,&quot;logo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;author_id&quot;:22682773,&quot;theme_var_background_pop&quot;:&quot;#BAA049&quot;,&quot;created_at&quot;:&quot;2020-12-18T18:17:20.987Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Type Safely&quot;,&quot;copyright&quot;:&quot;Type Safely&quot;,&quot;founding_plan_name&quot;:null,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;type_safely&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.typesafely.co.uk/p/make-a-random-number-generator-that?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!BWad!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png" loading="lazy"><span class="embedded-post-publication-name">Type Safely</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Make a Random Number Generator That Works With Float, Double and Int</div></div><div class="embedded-post-body">I want to be able to generate a random float, double, or integer within a given range. In order to do that, it helps to make NSNumber conform to the Comparable protocol. This makes it possible to decide whether one of these numbers is smaller, which will be useful later&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 years ago &#183; Type Safely</div></a></div><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:111475651,&quot;url&quot;:&quot;https://www.typesafely.co.uk/p/display-more-in-a-table-in-compact&quot;,&quot;publication_id&quot;:242083,&quot;publication_name&quot;:&quot;Type Safely&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;title&quot;:&quot;Display More in a Table in Compact Horizontal Size Classes&quot;,&quot;truncated_body_text&quot;:&quot;I&#8217;ve noticed that the SwiftUI Table view only displays one column when the horizontal size class is compact. This happens when the iPhone is in portrait orientation, which is also the way most apps are displayed in most cases. I wanted to make it possible to display information two types of information in a single colum&#8230;&quot;,&quot;date&quot;:&quot;2023-03-29T18:21:01.407Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:22682773,&quot;name&quot;:&quot;Type Safely&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/83c25740-5894-4255-aa34-c49f00c46a18_400x400.jpeg&quot;,&quot;bio&quot;:&quot;SwiftUI and Swift tips&quot;,&quot;profile_set_up_at&quot;:&quot;2023-02-18T01:20:07.774Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:18967,&quot;user_id&quot;:22682773,&quot;publication_id&quot;:242083,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:242083,&quot;name&quot;:&quot;Type Safely&quot;,&quot;subdomain&quot;:&quot;typesafely&quot;,&quot;custom_domain&quot;:&quot;www.typesafely.co.uk&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;SwiftUI tutorials every day&quot;,&quot;logo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png&quot;,&quot;author_id&quot;:22682773,&quot;theme_var_background_pop&quot;:&quot;#BAA049&quot;,&quot;created_at&quot;:&quot;2020-12-18T18:17:20.987Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Type Safely&quot;,&quot;copyright&quot;:&quot;Type Safely&quot;,&quot;founding_plan_name&quot;:null,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;type_safely&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.typesafely.co.uk/p/display-more-in-a-table-in-compact?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!BWad!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F253bf448-9346-4dba-ae0d-0fe53a8ff151_600x600.png" loading="lazy"><span class="embedded-post-publication-name">Type Safely</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Display More in a Table in Compact Horizontal Size Classes</div></div><div class="embedded-post-body">I&#8217;ve noticed that the SwiftUI Table view only displays one column when the horizontal size class is compact. This happens when the iPhone is in portrait orientation, which is also the way most apps are displayed in most cases. I wanted to make it possible to display information two types of information in a single colum&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 years ago &#183; Type Safely</div></a></div>]]></content:encoded></item></channel></rss>