<?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>SwiftUI on Abhishek Shukla</title><link>https://abhishekshukla.dev/tags/swiftui/</link><description>Recent content in SwiftUI on Abhishek Shukla</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 30 Jun 2026 10:38:19 +0530</lastBuildDate><atom:link href="https://abhishekshukla.dev/tags/swiftui/index.xml" rel="self" type="application/rss+xml"/><item><title>Understanding Opaque Types in Swift and SwiftUI: The Power of `some`</title><link>https://abhishekshukla.dev/blog/swift-opaque-type/</link><pubDate>Tue, 30 Jun 2026 10:38:19 +0530</pubDate><guid>https://abhishekshukla.dev/blog/swift-opaque-type/</guid><description>&lt;p&gt;If you have ever written a single line of SwiftUI, you have seen this code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-swift" data-lang="swift"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;var&lt;/span&gt; body: some View {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Text(&lt;span style="color:#e6db74"&gt;&amp;#34;Hello, World!&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That tiny word—&lt;code&gt;some&lt;/code&gt;—represents one of the most powerful and complex features introduced in modern Swift: &lt;strong&gt;Opaque Return Types&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;But what exactly does &lt;code&gt;some&lt;/code&gt; do? Why can&amp;rsquo;t we just return &lt;code&gt;View&lt;/code&gt;? And when should you use opaque types in your own non-UI Swift code? Let&amp;rsquo;s break down the &lt;em&gt;what&lt;/em&gt;, &lt;em&gt;why&lt;/em&gt;, &lt;em&gt;where&lt;/em&gt;, and the common violations.&lt;/p&gt;</description></item></channel></rss>