CodeX
Published in

CodeX

CODEX

Swift: Key Path Basics

Learn what KeyPaths are and how you can use them.

Photo by Joshua Reddekopp on Unsplash

Keypaths in Swift

Keypaths offer a dynamic and type-safe way of referencing properties of a type.

KeyPath<ObjectType, PropertyType>

A key path is a reference to a property, not to the value of the property.

--

--

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
Artturi Jalli

Artturi Jalli

I built a blog from 0 to 350k+ monthly visits in 16 months without SEO.