Common Mistake while using @Published | RunLoop.Main vs DispatchQueue.Main | Combine

  Рет қаралды 5,559

iCode

iCode

Күн бұрын

A very common mistake that we make while using the published property is missing the Schedulers while subscribing.
Due to this, the subscribers are notified about the change in the value of published property, but we do not get the data.
In this video, I've explained this problem, it's solution and difference between two schedulers i.e RunLoop.Main and DispatchQueue.main.
Useful Links 👇🏼
www.avanderlee...
forums.swift.o...
github.com/app...
github.com/app...

Пікірлер: 19
@DipendraLearning
@DipendraLearning 4 ай бұрын
Hi Pallav, thanks for explaining runloop, i was struggling to understand it & now I have some idea about it.
@lingeswarankandasamy7615
@lingeswarankandasamy7615 2 жыл бұрын
Hey Pallav I really like your teaching style and depth contents expecting more
@player98898
@player98898 2 жыл бұрын
Hey, Pallav.I really appearciate your efforts. Your videos are really helpful. I can see from last 4 months there is no new video. Please keep uploading the videos.My request is if possible, Please make one more video on App side system design and Low level design.
@sreelashsasikumar3540
@sreelashsasikumar3540 11 ай бұрын
Hi Pallav, thanks for your videos those are really helping to easily understand the concepts with in a few minutes. Great work. I do have a query that isn't @Published works only with SwiftUI, which was not getting observed with UIKit.
@aird1893
@aird1893 2 жыл бұрын
Thank you so much for the amazing short video, it gave me a proper detail to debugging as well
@barnaliroy3256
@barnaliroy3256 2 жыл бұрын
Can you please make one video related to background operations which will cover the topic OperationQueue and GCD. Thanks for all the video. its really helpful for me.
@yannic8344
@yannic8344 2 жыл бұрын
I don't think this is a proper solution to the problem as these schedulers dispatch work asynchronously to some time in the future. The real solution would be to use the parameter emitted by the observer which is omitted by the '_' in line 24. By using the publisher's emitted value we would decouple the view controller more from the view model since the table view data sources methods wouldn't reference the view model anymore. This is even the suggested solution by the guy which is referenced in the video description(avanderlee). It's easy to find the proper solution on his blog. @iCode: Maybe you should be doing a follow up video talking about this.
@syedzainpro
@syedzainpro 11 ай бұрын
Exactly
@rakeshmahato5326
@rakeshmahato5326 2 жыл бұрын
Pallav, why @observedObject is not used as property wrapper for viewModel instance in your example and ViewModel class is not extending to ObservableObject protocol ?
@pvj89
@pvj89 2 жыл бұрын
Hi Pallav, I have question can you please tell me how optional is implemented in swift? It was interview question.
@malleshaholeyache4464
@malleshaholeyache4464 2 жыл бұрын
Hi brother. May i ask why are you not posting any videos on your channel since last 5 months? Most of us eagerly waiting for your videos brother. Please do videos on iOS app development. Please guide us with your great knowledge by your astonishing explanation 😊🙂
@iCode_Happy_Coding
@iCode_Happy_Coding 2 жыл бұрын
Thanks for the kind words Mallesha. I’m working on something which is going to be very useful for most of the developers (beginner/intermediate). It’s a series of videos (on same topic) and most of it is done. Will try to release it by end of this month 🙂
@karthickchandran9899
@karthickchandran9899 2 жыл бұрын
Any chance we get a video on RxSwift too?
@JunaidKhan-ny8tu
@JunaidKhan-ny8tu 2 жыл бұрын
Kya bat hy yar ❤️
@rahuljamba5846
@rahuljamba5846 Жыл бұрын
Great Pallav , Keep it up
@im_the_raymond
@im_the_raymond 2 жыл бұрын
Hi Teacher.. I have a question: How can i execute a swift script or a swift line? Such as in python if I want to execute a python script or a python line i write: exec(“print(‘hello’)”) Please Help me 🙏🤍.
@swapnalikulkarni1472
@swapnalikulkarni1472 2 жыл бұрын
Hi Can you create a video on higher order functions
@pushpabisht4850
@pushpabisht4850 2 жыл бұрын
Good one 👍
@AmanKumar-tb8nt
@AmanKumar-tb8nt 2 жыл бұрын
Nice 👍
Main Thread, Sync vs Async and Deadlocks in Swift
9:49
iCode
Рет қаралды 13 М.
Will A Basketball Boat Hold My Weight?
00:30
MrBeast
Рет қаралды 89 МЛН
She's very CREATIVE💡💦 #camping #survival #bushcraft #outdoors #lifehack
00:26
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 262 #shorts
00:20
黑的奸计得逞 #古风
00:24
Black and white double fury
Рет қаралды 21 МЛН
MVVM + Dependency Injection in Swift | Unit Testing | iOS
29:29
RunLoop vs DispatchQueue || RunLoop Modes || iOS interview Questions
16:32
How to Check if a User Exists Among Billions! - 4 MUST Know Strategies
12:44
Will A Basketball Boat Hold My Weight?
00:30
MrBeast
Рет қаралды 89 МЛН