Open in app
Durul Dalkanat
4.1K Followers
About

Sign in

4.1K Followers
About
Open in app
Hashable Protocols in Swift
955
6

Joyce Matos

Durul Dalkanat

Durul Dalkanat

Dec 25, 2018·1 min read

With Swift 4.2, The Hashable protocol has been updated with a hash(into:) method that takes care of the hashing, instead of you rolling your own hashing calculation.

func hash(into hasher: inout Hasher) {
hasher.combine(uid)
hasher.combine(name)
hasher.combine(age)
}

Written by

Durul Dalkanat

Health Research Program’s iOS Developer, currently lives in Washington, D.C http://www.about.me/durul

  • Swift
  • iOS
  • Swift 4

More from Durul Dalkanat

Health Research Program’s iOS Developer, currently lives in Washington, D.C http://www.about.me/durul

More From Medium

50 iOS Interview Questions And Answers

Durul Dalkanat

How To Securely Access Your User’s Clipboard in iOS 14

Andrew Jackson in Better Programming

Presenting SwiftUI Views from ObjectiveC

Corey Davis

How to become an iOS developer in 30 days — Day 4 Protocols in classes, structs and enums

Tony Trejo

Bash Commands Guide

Durul Dalkanat

35 unforgettable images that capture Trump’s wild and bitter presidency

Business Insider in Business Insider

Armie Hammer Has Been Accused Of Being Into Cannibalism

Carrie Wynn in Fearless She Wrote

I’ll Never Be a Chief Technology Officer Again… Unless It’s for My Own Company

James Williams in The Innovation

About

Help

Legal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store