<?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>Protocols on Abhishek Shukla</title><link>https://abhishekshukla.dev/tags/protocols/</link><description>Recent content in Protocols on Abhishek Shukla</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 29 Jun 2026 10:00:00 +0530</lastBuildDate><atom:link href="https://abhishekshukla.dev/tags/protocols/index.xml" rel="self" type="application/rss+xml"/><item><title>Mastering Equatable, Comparable, and Hashable in Swift</title><link>https://abhishekshukla.dev/blog/equatable-comparable-hashable/</link><pubDate>Mon, 29 Jun 2026 10:00:00 +0530</pubDate><guid>https://abhishekshukla.dev/blog/equatable-comparable-hashable/</guid><description>&lt;p&gt;When building applications in Swift, you constantly need to compare objects, sort arrays, or store unique items in a &lt;code&gt;Set&lt;/code&gt; or &lt;code&gt;Dictionary&lt;/code&gt;. To do this efficiently, Swift relies on three fundamental protocols: &lt;strong&gt;Equatable&lt;/strong&gt;, &lt;strong&gt;Comparable&lt;/strong&gt;, and &lt;strong&gt;Hashable&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;While these protocols are easy to adopt, their behavior differs significantly depending on whether you are using a &lt;code&gt;struct&lt;/code&gt; or a &lt;code&gt;class&lt;/code&gt;. Let&amp;rsquo;s break down why we need them and how to implement them correctly.&lt;/p&gt;</description></item></channel></rss>