What is Hashable protocol in SwiftUI? | Continued Learning #12

Опубликовано: 12 Октябрь 2024
на канале: Swiftful Thinking
12,782
573

The Hashable protocol is very similar to the Identifiable protocol that I've been using throughout my courses - it's another way to give a unique identifier to an object. In reality, hashing is actually MUCH more complex than this, but this is all you really need to understand for our purposes. When we use hash values in SwiftUI applications it's usually to let the system identify which object is which.

Hashing is not unique to Swift/SwiftUI. It is often used in web development and cryptography (yes, in Blockchains and Bitcoin too). If you're interested, there are many articles and YouTube videos that go into detail on how hashing really works. Thankfully, we don't have to get into those details when we implement Apple's Hashable protocol.

Next video:    • Sort, Filter, and Map data arrays in ...  
Last video:    • How to schedule local Push Notificati...  

🤙 WELCOME BACK 🤙

WEBSITE: https://www.swiftful-thinking.com

DISCORD:   / discord  

GITHUB: https://github.com/SwiftfulThinking/

SAY THANKS: https://www.buymeacoffee.com/nicksarno