# Comparing Objects in Swift Using the Equatable Protocol

DevFeed: [Comparing Objects in Swift Using the Equatable Protocol](<https://devfeed.tech/articles/comparing-objects-in-swift-using-the-equatable-protocol-25519.md>)

Original publisher: [Read original article](<https://patrykkosieradzki.com/comparing-objects-in-swift-using-the-equatable-protocol>)

Published: 2024-04-16T00:00:00Z

Content type: tutorial

Language: en

Sources: [Patryk Kosieradzki](<https://devfeed.tech/sources/patryk-kosieradzki.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [enums](<https://devfeed.tech/tags/enums.md>), [examples](<https://devfeed.tech/tags/examples.md>), [extensions](<https://devfeed.tech/tags/extensions.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [ios](<https://devfeed.tech/tags/ios.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [object](<https://devfeed.tech/tags/object.md>), [protocol](<https://devfeed.tech/tags/protocol.md>), [standard-library](<https://devfeed.tech/tags/standard-library.md>), [swift](<https://devfeed.tech/tags/swift.md>), [types](<https://devfeed.tech/tags/types.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

## AI overview

This tutorial explains how to compare objects in Swift with the Equatable protocol. It covers compiler-synthesized conformance, requirements for stored properties and enum values, extensions for external types, and custom comparison logic.

## Source excerpt

How to improve object comparison in Swift using the Equatable protocol? See it in concrete examples.