Combine Framework FREE course: write you first iOS app - use Subscriptions & Publishers like Subject

  Переглядів 38,297

Karin Prater

Karin Prater

День тому

In this course, you will learn the basics of the Combine framework. This is for absolute beginners in functional reactive programming and Combine 🤩.
First I will explain how adding a subscriber like sink or assign to a publisher creates a subscription. You will learn how to cancel a subscription that means how to stop a data stream from passing values. You will also learn that passing an error 💣 will complete the data stream.
In the second section you will learn about a special type of publisher that is Subjects. I will show you how to use CurrentValueSubjects and PassthroughSubjects. In SwiftUI you can also use a publisher with the property wrapper @Published. You will learn the difference between these 3 publishers and their specific use cases.
We will also write 2 demo projects 👋 for UIKit and SwiftUI. The goal is to use Subjects and @Published to create data streams from user input.
By the end of this course, you will be able to create simple data streams between different parts of you projects.
I am using MVVM to illustrate how easy it is to separate tasks into their own components. Combine is a great tool for loose communication between different components. Comparable to the Delegate pattern, closures and observer pattern.
0:00 Intro
03:21 subscriptions
17:49 limited subscriptions
31:43 assign(to,on) Subscriber
40:56 assign(to,on) strong reference and memory cycle problems
46:55 assign(to) with @Published properties
52:55 multithreading with .receive(on) and subscribe(on)
01:01:36 subscription as the contract between publishers and subscribers
01:14:18 publishers
01:18:25 CurrentValueSubject
01:26:24 PassthroughSubject
01:39:42 @Published
01:49:25 Combine in SwiftUI
01:55:47 Demo project UIKit
02:12:13 Demo project SwiftUI
02:37:49 where to go from here
⬇️ download the playgrounds for course here:
school.swiftyplace.com/f/free...
👩🏻‍💻 Check out the full course:
school.swiftyplace.com/course...
📓 Resources to learn Combine:
www.swiftyplace.com/blog/how-...
How to go from here:
- convenience Publishers: Just, Future, Result, Fail, Empty
developer.apple.com/documenta...
- Foundation: URLSession dataTask publisher, Notification center, KVO publisher
- operators: map, tryMap, compactMap, scan, collect, append, decode
developer.apple.com/documenta...
- throwing errors: Fail publisher, Future with error
- error handling operators: catch, tryCatch, replaceError(with), assertNoFailure , mapError, setFailureType(to)
- multithreading: Schedular protocol, receive(on), subscribe(on), batch processing with flatMap and set number of task executed in parallel with flatMap(maxPublisher)
- control resources: dropFirst, debounce, throttle, filter, removeDupicates
- unit testing: functions that return AnyPublisher, eraseToAnyPublisher, Result.publisher
- communication design patterns can be replaced by Combine data streams: Delegate pattern, closures and Observer patterns
#CombineCourse#HowToUseCombine#SwiftCombine

КОМЕНТАРІ: 60
@SwiftyPlace
@SwiftyPlace 3 роки тому
This is the first 2.5 hours of my Combine course. If you enjoyed it and want to keep on going, you can grab a 15% discount at this link swiftyplace.newzenler.com/courses/master-combine-framework?coupon=UKpostsPROMO.
@3ilz
@3ilz Рік тому
Hi Karin, in total how long is the combine full course?
@rahuljamba5846
@rahuljamba5846 Місяць тому
Karin Prater great work keep it up, i appreciate your work !!! 😺
@reece5863
@reece5863 Рік тому
nice
@damaniturner6510
@damaniturner6510 3 роки тому
Outstanding!!
@ashoms0a
@ashoms0a 2 роки тому
Thanks a million for the great explanation!
@rodriferretty3001
@rodriferretty3001 3 роки тому
Thank you very much for your job. I really appreciate your effort! I love the way you ask yourself almost the same questions I'd ask my self while writing code, and actually you answer those questions which I find as an excellent way to teach. Thanks again. Liked, subscribed and moving forward to your other videos!
@tibettenballs4962
@tibettenballs4962 Рік тому
had an interview using combine a day ago. used it several times, but nothing to the effect of muscle memory / full understanding. was looking for a comprehensive tutorial and luckily found you last night. started this morning, and boy am i grateful for your contribution to youtube. thanks. not many people explain comine framework the way you do.
@whistlerbrad
@whistlerbrad 2 роки тому
Fantastic! 👏 I’m so glad I discovered this channel. Brilliant
@CraigTemple
@CraigTemple 3 роки тому
Thanks again for your incredible content! 🙏 ✨ You're an excellent teacher. I love the pace and format. It's like a mentoring session. Do you offer a code walkthrough service?
@saleemabbas4275
@saleemabbas4275 3 роки тому
i am so glad i found your channel , I am intending to build the next features of my app using SwiftUI and combine . Your way of explaining core concepts is marvellous keep doing great work.
@magicinternetmoney8715
@magicinternetmoney8715 2 роки тому
Insane value. Hats off to you Karin
@rgenericson5361
@rgenericson5361 3 роки тому
Good stuff! It really helps when showing applicable usage and benefits vs other approaches if any.
@mojota6938
@mojota6938 2 роки тому
I don't know what you do for a living, but if you're interested in an almost-certain pay cut, you'd make a great teacher!
@olha6017
@olha6017 Рік тому
Karin, you are the best! Thank you so much!!
@valerika9164
@valerika9164 3 роки тому
Karin hi, thank you for the tutorial 👍🏼 A lot of useful information! Especially I'm grateful for the structural presentation and comparison between UIKit and SwiftUI. It is obvious that you did spend a lot of time preparing this tutorial, thank you for that 🙌🏼
@AndGordy
@AndGordy 6 місяців тому
Solid, practical and in-depth material, as always. Thanks!
@luyuanqiang
@luyuanqiang 2 роки тому
Good work.😊
@mahtabhasan8513
@mahtabhasan8513 2 роки тому
I appreciate your effort in setting this topic COMBINE. Really it made me to understand well from the examples instead of breaking head reading docs. Anyhow still I need to look how to combine API etc. Thanks a lot.
@antonsergeyev2624
@antonsergeyev2624 2 роки тому
Such a useful Video. Thanks a lot!
@amdizle28
@amdizle28 Рік тому
This course is amazing at explaining the WHY & HOW, which leads to much greater understanding. THANK YOU
@arshadshaik2578
@arshadshaik2578 4 місяці тому
Thanks for your time and detail explanation.
@kareemfekry305
@kareemfekry305 Місяць тому
Thank you so much very professional and well detailed 💪
@hakeemdeggs9117
@hakeemdeggs9117 8 місяців тому
Amazing Karin!!!
@vijayjx
@vijayjx Рік тому
Great respect from India ❤. Keep up the good work, lot of knowledge in one video
@VitaliHalai-gh2yy
@VitaliHalai-gh2yy 2 місяці тому
Super good👍 Keep up a nice work🔥
@rodrigodeluca9389
@rodrigodeluca9389 2 роки тому
You're the best Karin Prater 🙌 Love your videos
@SwiftyPlace
@SwiftyPlace 2 роки тому
Thank you! 😊
@fredylopez529
@fredylopez529 Рік тому
THANK YOU!
@harshyadav9220
@harshyadav9220 2 роки тому
thankyou very much for such great explanation :)
@SwiftyPlace
@SwiftyPlace 2 роки тому
Welcome 😊
@13Ilya47
@13Ilya47 3 роки тому
Thanks!
@tajapan
@tajapan 2 роки тому
thanks for the course! Is the code missing from the playground files?
@jatinnandwani6678
@jatinnandwani6678 Рік тому
Thanks so much
@gexhange
@gexhange 3 роки тому
Hi, can yu make a video explaining how many viewModels I need in a MVVM project and how to share data between them? Or do I only need one viewModel? Thanks!! Amazing videos
@bonnydonny
@bonnydonny 3 роки тому
👍 I paused at 48 min. to take a break. Whew.
@Ivoshevo
@Ivoshevo 2 роки тому
Nice Explanation: But can you please do a video on how to do an HTTP post request using SwiftUI with Combine?
@chezchezchezchez
@chezchezchezchez 8 місяців тому
2023 noob. Why do I need combine? Thx
@ColeDano
@ColeDano 3 роки тому
Hey Karin, what is the difference between this course and the one on SwiftyPlace? Looking forward to the beginners course coming out as well.
@SwiftyPlace
@SwiftyPlace 3 роки тому
Hi Cole, this is the first 2.5h hours of the course at my website SwiftyPlace, where I have about 22h of content. What are you looking for beginners? To learn SwiftUI or Swift?
@ColeDano
@ColeDano 3 роки тому
@@SwiftyPlace Thanks for the reply, good to know that. When I’m ready, I’ll get into the Combine course. I’ve been learning Swift and SwiftUI concurrently, so I guess the answer is both, but mostly SwiftUI. Since you’re channel moniker is PhysicsNerd, I got my degree in Physics in 1988, where we learned FORTRAN. I’ve been out of that world for a long time, but have a situation where I’d like to try to develop an app, and find SwiftUI very appealing, and as I learn more about Combine, even more so. Thanks again.
@SwiftyPlace
@SwiftyPlace 3 роки тому
@@ColeDano I did not learn FORTRAN anymore. They gave us MATLAB, which is only used at universities. I would have preferred python. But iOS development is more fun ;)
@ColeDano
@ColeDano 3 роки тому
@@SwiftyPlace it sure is!
@joed8805
@joed8805 3 роки тому
Am not sure if it is feasible, if you can have a monthly subscription model for your site, it will be very helpful around 20 dollars. You can keep on adding courses. Also, currently there Is no way to pay other than Paypal. Atleast credit card payment should be there.
@SwiftyPlace
@SwiftyPlace 3 роки тому
Thanks for the feedback. I will try to implement a subscription model and check the payment options with my current platform provider.
@ilushk
@ilushk 3 роки тому
Please explain about how widgets work😭
@vamsi3877
@vamsi3877 3 роки тому
It would be really helpful if you breakdown full video into several parts
@gjermundification
@gjermundification 3 роки тому
There is a breakdown of the video in comments section.
@johnnylane9577
@johnnylane9577 Рік тому
nice cat 😆
@joed8805
@joed8805 3 роки тому
Can you explain the flatmap operator pls.
@SwiftyPlace
@SwiftyPlace 3 роки тому
I will make a video about it because flatmap is super useful. Maybe next week or so ;)
@joed8805
@joed8805 3 роки тому
@@SwiftyPlace Awesome. Thank you.
@KFrench1123
@KFrench1123 7 місяців тому
The white background is hard on my 👀
@eduardofulgencio741
@eduardofulgencio741 Рік тому
Brutal
@tantran1109
@tantran1109 2 роки тому
I have a question for the receive(on: _ ). In the example of assign related to the strong reference memory problem, with the same source code, I tried adding user.map(\.id).receive(on: RunLoop.main, options: nil).sink { [weak self] user in ... } The output is only "deinit" which means the line "userId changed" did not appear. Do you know why?
@AnujKumar-mt6zi
@AnujKumar-mt6zi Місяць тому
@jordibruin
@jordibruin 3 роки тому
Thanks!
Дурнєв дивиться сторіс ZОМБІ #47
53:48
Aleksey Durnev
Переглядів 698 тис.
Swift API Calls for Beginners (Networking) - Async Await & JSON
25:35
8 Common SwiftUI Mistakes - and how to fix them!
28:05
Paul Hudson
Переглядів 49 тис.
Has Generative AI Already Peaked? - Computerphile
12:48
Computerphile
Переглядів 189 тис.
How I'd Learn iOS Development Starting Over!
4:48
CodeWithChris
Переглядів 48 тис.
Master The Combine Framework: From Beginner to Advanced
1:32:13
tundsdev
Переглядів 36 тис.
Most overpowered way to build mobile apps?
8:33
Beyond Fireship
Переглядів 678 тис.
Дурнєв дивиться сторіс ZОМБІ #47
53:48
Aleksey Durnev
Переглядів 698 тис.