Тёмный

How to use KeyPaths in Swift | Advanced Learning #29 

Swiftful Thinking
Подписаться 46 тыс.
Просмотров 3,1 тыс.
50% 1

In Swift, a KeyPath is a way to reference a property, or a nested set of properties, of a particular type in a type-safe manner. It provides a convenient and type-checked way to access properties and their values without needing to use string-based key-value coding (KVC) or dynamic member lookup. KeyPaths are often used in Swift for tasks like sorting, filtering, or key-value observation, and they contribute to safer, more predictable code.
🤙 WELCOME BACK 🤙
WEBSITE: www.swiftful-thinking.com
DISCORD: / discord
GITHUB: github.com/SwiftfulThinking/
SAY THANKS: www.buymeacoffee.com/nicksarno
00:00 Keypaths
01:38 Welcome back!
02:26 What is a Keypath?
04:40 Basic Keypaths
07:37 Nested Keypaths
08:40 Keypaths for custom methods
11:09 Sorting with Keypaths
13:14 Creating an extension
18:08 Adding generics
19:30 Polish & Optimizations
23:35 Wrapping up

Опубликовано:

 

30 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 18   
@RobertHolzapfel
@RobertHolzapfel 8 месяцев назад
I am so glad, that you started again publishing these videos, even more, since they address advanced developers ...I am loving it. THANK YOU.
@larschristiansen3136
@larschristiansen3136 Месяц назад
Great Presentations, great suspense , looking forward to the next two videos
@sherelynsilverio2719
@sherelynsilverio2719 5 месяцев назад
Hi Nick. Been waiting for your SwiftData tutorial
@kdtechniquesofficial6153
@kdtechniquesofficial6153 3 месяца назад
Awesome as always... 👨🏻‍💻
@w0mblemania
@w0mblemania 7 месяцев назад
Thanks for this. It was very well done. It's great to see some of these more advanced topics on RU-vid.
@magicinternetmoney8715
@magicinternetmoney8715 8 месяцев назад
loving this series
@bassemmagdi6671
@bassemmagdi6671 8 месяцев назад
One of a kind instructor Truly amazing work Thank you so much ❤
@treboc2942
@treboc2942 7 месяцев назад
Really nice! Thanks for this.
@07ellboy
@07ellboy 8 месяцев назад
Yes Sir ! This playlist is lit 🔥🧯
@josemanuelortizsanchez4983
@josemanuelortizsanchez4983 7 месяцев назад
Thanks, Nick!!
@arnosolo2008
@arnosolo2008 8 месяцев назад
Thank you 😺
@simply6162
@simply6162 8 месяцев назад
ahhh this is the video was waiting for :D !!!
@tawroof9353
@tawroof9353 8 месяцев назад
Hey, Your videos is real amazing. Even english is not my native language I understand everything and I enjoy your videos, but i have a question are you going to make videos about uikit i think it will be helpful. Thank you so much
@alexvaiman4966
@alexvaiman4966 3 месяца назад
You missed the part when key path used to inject environment variables. , PS key/path, is very old objective-c days thing, used to dynamically observe changes in your class, subscribe to some key-path, and then act on a change.
@SwiftfulThinking
@SwiftfulThinking 3 месяца назад
The next videos cover property wrappers and will include environment variables! Thanks for the obj-c background, I didn’t know that
@yashpatil5946
@yashpatil5946 8 месяцев назад
I can’t find the use of keyPath
@philippegden9826
@philippegden9826 8 месяцев назад
They are super useful when you want the user to be able choose a specific field in some model. Let me try and make that more real: I developed a photo asset manager. One feature allows the user to choose which metadata field they wanted to display against the thumbnails (e.g. filename, date, camera, etc). I created an enum with cases for each metadata field. Then I had a computed property which would return the associated keypath for each case. With this done, it was relatively easy to show the user a picker of all the fields available, and then use the setting to display the field chosen. There are of course many routes to Rome, but I found key paths super useful in this project.
@eddiecarbon146
@eddiecarbon146 8 месяцев назад
Hi Nick! Are you planning to create an application for advanced users?🥹 Maybe with firebase? Your videos are great❤, I've been watching all your materials from the beginning!
Далее
How to use Dictionaries in Swift | Swift Basics #14
18:51
Ummmm We "HAIR" You!
00:59
Просмотров 13 млн
치토스로 체감되는 요즘 물가
00:16
Просмотров 1,1 млн
How to use Lazy in Swift
9:56
Просмотров 38 тыс.
How to use Protocols in Swift | Advanced Learning #15
28:37
A Simpler Way to See Results
19:17
Просмотров 98 тыс.
How to use AsyncStream in Swift | Swift Concurrency #18
26:32
Generics: The most intimidating TypeScript feature
18:19
Why should you use KeyPaths? 🤔
7:50
Просмотров 2,7 тыс.