<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Swift on Abhishek Shukla</title><link>https://abhishekshukla.dev/tags/swift/</link><description>Recent content in Swift on Abhishek Shukla</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 12 Mar 2026 17:40:17 +0530</lastBuildDate><atom:link href="https://abhishekshukla.dev/tags/swift/index.xml" rel="self" type="application/rss+xml"/><item><title>How Copy-on-Write(CoW) in Swift works and optimizes memory</title><link>https://abhishekshukla.dev/blog/copy-on-writecow/</link><pubDate>Tue, 03 Mar 2026 13:47:17 +0530</pubDate><guid>https://abhishekshukla.dev/blog/copy-on-writecow/</guid><description>&lt;p&gt;Swift is designed around two core principles: &lt;strong&gt;safety&lt;/strong&gt; and &lt;strong&gt;performance&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;At first glance, these goals often appear to conflict. Value types provide safety and predictability, but copying large values repeatedly can be expensive. Reference types provide efficiency through shared storage, but they introduce shared mutable state.&lt;/p&gt;
&lt;p&gt;Swift solves this tension elegantly through a memory optimization technique called &lt;strong&gt;Copy-on-Write (CoW).&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you’ve used Array, Dictionary, Set, or String, you’ve already relied on Copy-on-Write — even if you didn’t realize it.&lt;/p&gt;</description></item><item><title>Swift Sendable Explained - Compile Time Data Race Prevention in Swift Concurrency</title><link>https://abhishekshukla.dev/blog/swift-sendable/</link><pubDate>Tue, 10 Mar 2026 18:40:17 +0530</pubDate><guid>https://abhishekshukla.dev/blog/swift-sendable/</guid><description>&lt;p&gt;Swift Concurrency introduced one of the most important safety improvements in the language: compile-time data race detection.&lt;/p&gt;
&lt;p&gt;Before Swift Concurrency, it was possible to accidentally access mutable state from multiple threads at the same time. These bugs were notoriously difficult to reproduce because they depended on timing and thread scheduling. An application might work perfectly for months and then suddenly crash or corrupt data in production.&lt;/p&gt;
&lt;p&gt;Swift&amp;rsquo;s concurrency model takes a different approach:&lt;/p&gt;</description></item><item><title>Swift Task Lifecycle Management - Structured vs Unstructured Concurrency</title><link>https://abhishekshukla.dev/blog/swift-task-life-cycle/</link><pubDate>Thu, 12 Mar 2026 17:40:17 +0530</pubDate><guid>https://abhishekshukla.dev/blog/swift-task-life-cycle/</guid><description>&lt;p&gt;Swift Concurrency fundamentally changed how asynchronous programming works in Swift. Before async/await arrived, developers relied heavily on completion handlers, delegates, Combine pipelines, and Grand Central Dispatch (GCD). These approaches worked, but they often made asynchronous code difficult to reason about, debug, and maintain.&lt;/p&gt;
&lt;p&gt;With Swift Concurrency, Apple introduced a model centered around &lt;strong&gt;tasks, structured concurrency&lt;/strong&gt;, and &lt;strong&gt;actor isolation&lt;/strong&gt;. One of the most important concepts to understand in this model is the difference between &lt;strong&gt;structured&lt;/strong&gt; and &lt;strong&gt;unstructured&lt;/strong&gt; concurrency.&lt;/p&gt;</description></item></channel></rss>