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

  Рет қаралды 3,095

Vincent Pradeilles

Vincent Pradeilles

Күн бұрын

Пікірлер: 12
@v_pradeilles
@v_pradeilles 3 жыл бұрын
⚠️ 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 3 жыл бұрын
Once again great topic, amazing content. Thanks Vincent!
@KK-pq6lu
@KK-pq6lu 3 жыл бұрын
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 3 жыл бұрын
Good idea!
@EmmaKAlexandra
@EmmaKAlexandra 3 жыл бұрын
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 3 жыл бұрын
Doesn’t follow the principle of separation of concerns. They really should have a separate modifier to hold/retain the reference.
@조요한-y1e
@조요한-y1e Жыл бұрын
Wow ! migration to my project now.
@andybezaire
@andybezaire 3 жыл бұрын
Another great video. 🚀🚀🚀 Question: Why did you choose for NumberGenerator to be a class instead of a struct?
@poluxsaurus1454
@poluxsaurus1454 3 жыл бұрын
I think it’s because it manages a Timer therefore it needs to be able to mutate itself.
@randomdoodler
@randomdoodler 3 жыл бұрын
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 3 жыл бұрын
Good point! Yes of course, in a real app I would definitely recommend introducing a few model later such as the one you described 👍
@dev_jeongdaeri
@dev_jeongdaeri 3 жыл бұрын
Holymoly!!! 😭👍
Как Я Брата ОБМАНУЛ (смешное видео, прикол, юмор, поржать)
00:59
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 6 МЛН
Lamborghini vs Smoke 😱
00:38
Topper Guild
Рет қаралды 57 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 45 МЛН
I Tried YouTube Shorts For 7 Days crazy 🤪 results
3:18
AsyncStreams Intro in Swift (Concurrency) - 2022
8:53
iOS Academy
Рет қаралды 7 М.
iOS Dev 35: MVVM Binder using Combine | Swift 5, XCode 13
9:34
Emmanuel Okwara
Рет қаралды 10 М.
How do you go from completionHandler to async / await? 🤔
12:23
Vincent Pradeilles
Рет қаралды 2,6 М.
meet asyncsequence
14:21
Emrul Hasan Zawad
Рет қаралды 225
iOS DEV: How to test Combine/RxSwift publishers fast? | ED Clips
9:02
Essential Developer
Рет қаралды 1,7 М.
How to use AsyncStream in Swift | Swift Concurrency #18
26:32
Swiftful Thinking
Рет қаралды 7 М.
Your Brain 🧠 on Swift Concurrency - iOS Conf SG 2023
30:38
iOS Conf SG
Рет қаралды 10 М.
Как Я Брата ОБМАНУЛ (смешное видео, прикол, юмор, поржать)
00:59