SwiftUI Tutorial: Using Combine to Debounce User Input
SwiftUI Tutorial: Using Combine to Debounce User Input
In this series, we’re going to succinctly solve the problem of debouncing view state using a combination of Combine and property wrappers. In this episode we will be using Combine to debounce user input.
Source code:
https://gist.github.com/CodeSlicing/96e2d15a701ca862a8c33d49e79c805d
Native source code:
https://gist.github.com/CodeSlicing/aa10b72636745e1bb1654a86094d87d5
================
PureSwiftUI is a free Swift Package that includes a multitude of useful extensions and properties to make your life easier with SwiftUI resulting in cleaner code that takes less time to write.
It's a huge time-saver so I do encourage you to check it out.
You can get PureSwiftUI here:
https://github.com/CodeSlicing/pure-swift-ui
If you want to ask me a question or follow me for updates, you can do so on Twitter:
https://twitter.com/codeslice
FAQs:
Q: What are the code callouts I sometimes see in the code?:
A: I code in SwiftUI using the PureSwiftUI framework since I created it to make code more concise and easier to read. However, I understand that not everyone wants to install a swift package (although, you'd be mad not to ;o)) so unless otherwise stated, the popups will detail the native SwiftUI equivalent of the code in question.
Q: What's that theme you're using?
A: It’s a modified version of MoodNight v2. If you like it, you can download the theme here:
https://github.com/CodeSlicing/codeslicing-youtube-resources/tree/develop/global/Xcode/themes
Q: Why do you use a harness structure rather than the default preview provider
A: Please take a look at this video for a detailed explanation: https://youtu.be/uO17ofc5a54
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «SwiftUI Tutorial: Using Combine to Debounce User Input», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.