Тёмный

Meet the new alternative to Combine's Publisher! (it's called AsyncStream) 

Vincent Pradeilles
Подписаться 17 тыс.
Просмотров 3 тыс.
50% 1

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

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 12   
@v_pradeilles
@v_pradeilles 2 года назад
⚠️ I forgot an important piece of information! AsyncStream will be back ported to iOS 13 in Xcode 13.2, which is currently in beta. So right now if you use Xcode's latest stable version (Xcode 13.1), you'll notice that AsyncStream is iOS 15 only, and that's totally normal.
@LucasAbijmil
@LucasAbijmil 2 года назад
Once again great topic, amazing content. Thanks Vincent!
@KK-pq6lu
@KK-pq6lu 2 года назад
Would be nice to have a follow on video, starting with the code you have in this video, to add a button to stop the number generator - to show cleanest way how to suspend or even end a task.
@v_pradeilles
@v_pradeilles 2 года назад
Good idea!
@조요한-y1e
@조요한-y1e Год назад
Wow ! migration to my project now.
@EmmaKAlexandra
@EmmaKAlexandra 2 года назад
Pretty cool. Only being able to retain the generator because of the onTermination closure is pretty weird. Rust handles this kind of pattern using `move` to give ownership of a variable into a new context. Seems like it might be handy in Swift!
@KK-pq6lu
@KK-pq6lu 2 года назад
Doesn’t follow the principle of separation of concerns. They really should have a separate modifier to hold/retain the reference.
@dev_jeongdaeri
@dev_jeongdaeri 2 года назад
Holymoly!!! 😭👍
@randomdoodler
@randomdoodler 2 года назад
Great video! I saw that you use the async stream in a task closure in the content view struct. Ideally we don’t want too much logic in the view. Nice thing about Combine is that all the observation logic can go into an ObservableObject class and it writes into a @Published var, and view just has to display that published var from the @ObservedObject. Can async/await do the same? (Let the for await code be in a separate class and the view just displays a var without having any observation logic)
@v_pradeilles
@v_pradeilles 2 года назад
Good point! Yes of course, in a real app I would definitely recommend introducing a few model later such as the one you described 👍
@andybezaire
@andybezaire 2 года назад
Another great video. 🚀🚀🚀 Question: Why did you choose for NumberGenerator to be a class instead of a struct?
@poluxsaurus1454
@poluxsaurus1454 2 года назад
I think it’s because it manages a Timer therefore it needs to be able to mutate itself.
Далее
НОВАЯ "БУХАНКА" 2024. ФИНАЛ
1:39:04
Просмотров 173 тыс.
AsyncStreams Intro in Swift (Concurrency) - 2022
8:53
Reconsidering @Published - Combine to Async Part 1
8:37
SwiftNIO and Network.framework
27:01
Просмотров 4,2 тыс.
Networking in Combine
15:02
Просмотров 878
Async Sequence in Swift (2022)
11:11
Просмотров 9 тыс.