Тёмный
No video :(

MVVM + Dependency Injection in Swift | Unit Testing | iOS 

iCode
Подписаться 15 тыс.
Просмотров 44 тыс.
50% 1

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

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 92   
@pradipdeore8068
@pradipdeore8068 2 месяца назад
The way you explain complex things in simpler terms is just awesome. You videos are very unique and helpful. Thanks for sharing this.
@ahmadwaqas6044
@ahmadwaqas6044 2 года назад
Why I haven’t seen your channel before. Top quality content. Looking forward to learn topics coordinators, architecture, unit tests, rxswift and anything you make :)
@avgguy7129
@avgguy7129 2 года назад
I am in search for this resource last few days. But haven’t seen here until this. Thank you!
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Glad that you found the video useful 🙂
@SaiTejaDande
@SaiTejaDande 2 месяца назад
Best explanation I have ever heard about MVVM. You cleared all my doubts Thank you.
@aaronwalker5493
@aaronwalker5493 2 года назад
Excellent explanation, without any unnecessary details!
@ronrolle7610
@ronrolle7610 2 года назад
I just discovered your channel recently. Nothing more to say, than 11 out of 10. Really top of the line content. I appreciate your effort very much.
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Thank you Ron. Glad that you liked the content 🙂
@iqbalzauqul2589
@iqbalzauqul2589 2 года назад
This is a very detailed video about MVVM that i think no other youtuber did. Thank you.
@saidalr494
@saidalr494 2 года назад
Brief but covered all possible questions. Easy to understand. Great explanation and great work. Thanks for this video.
@LijiLinto-us9fw
@LijiLinto-us9fw 2 месяца назад
very beneficial.. Thanks a lot.. Keep posting
@shashikumar740
@shashikumar740 2 года назад
Well explained, I really liked it the way you explained the MVVM pattern 🔥
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Thanks Shashi 🙂
@sajishtr
@sajishtr Год назад
As few others commented, there is a slight disagreement on the use of VM. The primary purpose of all view patterns are for separating presentation logic away from business logic. So VM as the name suggests should contain only fields and logic specific to a view or set of views. The fields in VM should be subset of actual Model and logic in VM is mainly presentation oriented like formatting a date for the view or responding the change of a field in the view. The core business logic (that could include using network calls to achieve that) and full set of fields should be part of the Model.
@swiftAI
@swiftAI Год назад
IMO Networking can be called in the viewmodel, but the viewmodel shouldn't have actual implementation of networking. It should call some abstract services which have the networking injected. External services can fetch the model itself. Then, like you said, all the viewmodel does is convert the model to data that the view can render. So the viewmodel doesn't technically contain the networking either, and neither should the model... since the abstract service itself might be fetching the model.
@sourishkeka
@sourishkeka 2 года назад
Top class explanation of ViewModel and Dependency Injection. I really wonder how did I miss this..
@pranjalverma6328
@pranjalverma6328 2 года назад
this explains very well awesome video and thanks for clearing my concepts about dependency injection and testCases.
@noperfection5341
@noperfection5341 2 года назад
Thanks for the interesting Tutorial. You explian it in a easy and straight way.Keep it up!!. Thank you!
@swatisrivastava1174
@swatisrivastava1174 2 года назад
Awesome video...finally gt to understand.. Thanks !!
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Glad that you found it useful, thanks 🙂
@SaiTejaDande
@SaiTejaDande 2 месяца назад
Can you also explain a comparisons and best practices between MVC, MVP and MVVM. So that we will have full clarity about Architectural Patterns..
@aird1893
@aird1893 2 года назад
Very well Explained. Thank you
@malleshaholeyache4464
@malleshaholeyache4464 2 года назад
Awesome explanation brother 👏👏. You please keep posting all videos related to Swift iOS . I have great hope that many of us get benefitted from your explanation and questions you ask in every step🙂. We need a gem like you in every learning curves😊
@sivakrishna5293
@sivakrishna5293 2 года назад
Great Video, easy and clean explanation.
@tokero5199
@tokero5199 2 года назад
Really nice video with a lot of good points that other videos on the topic missed. I do have a few issues with it. Calling MV* patterns architecture seems wrong to me. They are patterns designed to solve a specific issue. They are not themself the architecture of the app, seeing them as architecture is what causes people to try to cram all code into one of the letters of the acronym which is not the point with the patterns, it's is also what lead to strange bastard patterns like MVC-N and MVVM-C. MV* patterns are a great tool and they do participate inf the architecture but, they are not THE architecture. Also, you talk like 100% test coverage in itself is a goal, while you should strive for good coverage, the coverage itself is not a way to measure quality as the tests cold be testing absolutely nothing.
@NicolasFrugoni1
@NicolasFrugoni1 11 месяцев назад
This! I think this is why it's so hard to bring architecture as a topic on companies, because all the tutorials or learning content treats MVP or mvvm as architecture, so something like Clean Architecture becomes something that seems a theoretical ideal and people usually don't see what the point even is! Also it seems this video doesn't fully showcase dependency inversion, as it's using singletons left and right and not showing how to fully take advantage of the pattern! One could also argue that the view should not ask for the VM for data but just use the published properties, but here there's a bunch of exposed methods
@puneetpal1466
@puneetpal1466 2 года назад
Again as always its awesome and detailed explanation :)
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Thanks Puneet 🙂
@anilhanumante8956
@anilhanumante8956 Год назад
Superb man...loved your explaination
@SainiAnil2502
@SainiAnil2502 2 года назад
As per MVVM view should not be aware about model however when you explained about protocol the closure, it was returning array of flight object to the View in this case view is dependent on model. I was explaining the exactly what you mentioned in one of the Apple interview however interviewer told me as per MVVM view should not be aware about model. What is your thought on it?
@sagarchandradas6326
@sagarchandradas6326 2 года назад
Top-quality contents. Carry on and help us.
@karaokedeconstruction
@karaokedeconstruction 2 года назад
very good tutorial, thank you for your explanation.
@dhavalnena7386
@dhavalnena7386 2 года назад
Very well explained !! Thanks
@_marlon
@_marlon Месяц назад
Great video
@meerasayabu3823
@meerasayabu3823 2 года назад
Cool tut. Great work brother.
@dhav7634
@dhav7634 2 года назад
Great video as always. One question I was having is that what's the use case for the model to communicate back to the ViewModel? I understand that View Model is responsible for say making the network call and update the model but didn't come up with a use case where the model changes (without VM's involvement) and needs to communicate back to the VM.
@dewas6237
@dewas6237 2 года назад
awesome one so far!
@prithviraj8733
@prithviraj8733 2 года назад
So detailed explanation. Thanks for sharing
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Glad that you liked the video. Thanks🙂
@mrflixflix
@mrflixflix 2 года назад
At 9:50 you talk about the folder structure. As an alternative I suggest keeping the 3 folders Views, viewModels and Models, while keeping the folder structure of the viewModels folder flat. Any hierarchy will be found in the Views folder and the corresponding view model for a view can be found easily. I suggest defining each view model in an extension of it's view. What do you think?
@rohitmishra8633
@rohitmishra8633 Год назад
Thank you bro.
@pushpabisht4850
@pushpabisht4850 2 года назад
Your videos r really helpful, thank you 🙏
@khadijadaruwala3380
@khadijadaruwala3380 2 года назад
Thank you for the informative video. Can you please create a video for implementing unit tests for API calls
@akashrevanna5327
@akashrevanna5327 2 года назад
thanks for this detailed explanation✌️
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Thanks Akash, glad that you like it 🙂
@HumbleHustle101
@HumbleHustle101 2 года назад
Great video. Please also make a video explaining the implementation of RIBs architecture aswell. Thanks in Advance.
@ankitbhana9852
@ankitbhana9852 2 года назад
Great video!! Thanks
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Thanks Ankit 🙂
@nileshtupe2553
@nileshtupe2553 2 года назад
Thanks!
@honestperson8296
@honestperson8296 2 года назад
please make a video on solid principles in swift.
@sagarkadam8036
@sagarkadam8036 2 года назад
Excellent content, wish we had your videos earlier but nevertheless its a brilliant content.. keep on publishing videos.. Best Wishes !!! I had a query, Dependancy Injection - With help of Sw-Inject how it can be used & implemented ? Would love to have a video on the same. Many Thanks !!!!
@sharadgd3912
@sharadgd3912 2 года назад
Can you make a video on clean architecture with MVVM.
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Thanks for the suggestion Sharad, I’ll try to cover it 🙂
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Don’t have anything concrete on Clean as of now. I’ll let you know whenever I’ll cover it.
@LittleLearners-junior
@LittleLearners-junior 2 года назад
one of the best videos
@aksharaunnikrishnan332
@aksharaunnikrishnan332 Год назад
Hi, it would be great if you create a video on MVVM issues on SwiftUI
@csmaisuriya91
@csmaisuriya91 Год назад
Can you please tell us 1. how to identify when to use MVC or MVVM? 2. WhY we use MVVM over MVC? Thanks.
@user223-bv3bk
@user223-bv3bk 3 месяца назад
1:35 struggle begins 🤭😀 🤣🤣
@subysukumaran3803
@subysukumaran3803 3 месяца назад
Some blogs are saying we can create the view model as an extension of content view in SwiftUI and create a @State variable of view model in content view to receive the viewmodel updates. Is it a good practice ?
@luvs_2k4
@luvs_2k4 10 месяцев назад
Can we use "Color" in ViewModel, because it needs SwiftUI to be imported in ViewModel. I have some logic related to color to be implemented in ViewModel. How can I do it without using SwiftUI in ViewModel?
@MAHOSSAN1
@MAHOSSAN1 2 года назад
Thank for the lecture . I download the project but I am not able to run it . can you please explain to run the project ?
@sweetlemon6049
@sweetlemon6049 2 года назад
Thanks Pallav 👌🏻
@UK-lp7no
@UK-lp7no 2 года назад
Thanks for another great video dude! You mentioned, we only keep business logic in VM. How about some other app logic such as date components, calculator formula etc? I know you also mentioned those should be a separated class but how do we call them, from VM or VC?
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Those utility methods can be extensions of their classes (eg. Date), or static functions may be, so that you can directly call them without instance. Some people prefer having a singleton (say Helper) or global functions for these stuff. If you want to have an instance, you can have it injected through some method.
@bamanstech3006
@bamanstech3006 2 года назад
Thank you
@ranaasifmahmood8613
@ranaasifmahmood8613 2 года назад
Thank you for the great, well explained video on MVVM and dependency injection. I am wondering if you can make a video on Apple's device check api.
@eahmedshendy
@eahmedshendy 2 года назад
May you please keep xcode version compatible with 12.4 (12D4e) in next videos, there is some people still cannot upgrade to latest version of OS/Xcode.
@TenderAI
@TenderAI Год назад
Awesome explanation MAN! BTW, the source code link was expired, could you help to check and update it?
@jalakampradeep
@jalakampradeep 2 года назад
Pallav with your experience, I think you should make a udemy coarse targeting ios interview.
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Thanks for the suggestion Pradeep. I'll look for doing that 🙂
@bonnyvarghese4860
@bonnyvarghese4860 2 года назад
great job . Keep going.
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Thanks 🙂
@VirenderDall
@VirenderDall 2 года назад
Hi Pallav Thank you for the wonderful videos. I have one question why did you make the protocol as type of any object? Just to use weak? If this is the case then how a struct will implement that protocol? and in case if implement then how it can be reference type? 🤯
@shaikrahim8071
@shaikrahim8071 2 года назад
Protocal can be use any type. By deafult they are Any. To restrict the use struct and enum. We should use anyobject. Anyobject is reference type. Then any reference make stronge recycle count to make the. weak.
@harooniqbal210
@harooniqbal210 2 года назад
Hi Great Tutorial, I have a confusion in UIKit when using MVVM and dependency injection while sending data to DetailViewController. Can you please provide me any code snippet for that. Or share link if you have any tutorial on it. Thanks in advance!
@victorriurean
@victorriurean 2 года назад
nice
@keerthanas4813
@keerthanas4813 2 года назад
Hi bro where should I use presentation logic
@Khl8122
@Khl8122 8 месяцев назад
Where’s the server code?
@lokeshchinatatareddy1069
@lokeshchinatatareddy1069 2 года назад
Will you make vedio about databuilding in MVVM for us please
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Thanks for the suggestion Lokesh. I'll try to cover it soon. 🙂
@lukassbeataddicts
@lukassbeataddicts 2 года назад
This is good but how to test network call?
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
We can test network calls by writing stubs. By creating fake URLSession, overriding resume method of URLSessionDataTask, and returning dummy response from it. I'll try covering it. Thanks for the suggestion 🙂
@rahmanbramantya8266
@rahmanbramantya8266 2 года назад
Hi i have a question,can the viewmodel layer be reusable for multiple view layer? Or everytime you create a new view controller you always have to create the new viewmodel even though it have the same use case with the existing viewmodel file
@nashtravelandlifestyle
@nashtravelandlifestyle Год назад
One of the purposes of mvvm is to have a reusable viewmodel and model.
@lukassbeataddicts
@lukassbeataddicts 2 года назад
Combine is a powerful thing, shame Apple not updating it at all.
@tokero5199
@tokero5199 2 года назад
I'm new to Combine. What needs to be updated?
@rajattyagi4602
@rajattyagi4602 2 года назад
Hi Pallav, can you make a video on LLD in iOS. It would be a great help :)
@iCode_Happy_Coding
@iCode_Happy_Coding 2 года назад
Thanks for the suggestion Rajat. I’ll try covering it 🙂
@InvestHyd
@InvestHyd Год назад
Out of 25 mins video you explained starting 15 mins on combine and protocol. Content is good but need to concentrate on actual stuff
@milansiyainfotech89
@milansiyainfotech89 2 года назад
Business logic should be a part of the model.
@quadraSpazed
@quadraSpazed 10 месяцев назад
The whole point of SwiftUI is that it's declarative and driven by state. You shouldn't be using delegates. Also why are you creating box listeners when you're using combine?
@guidence9151
@guidence9151 2 года назад
Thank you
Далее
СМАЗАЛ ДВЕРЬ
00:31
Просмотров 161 тыс.
Cute kitty gadgets 💛
00:24
Просмотров 12 млн
Only I get to bully my sister 😤
00:27
Просмотров 19 млн
Dependency injection в Swift.
25:35
Просмотров 1,9 тыс.
NGINX Tutorial - What is Nginx
14:32
Просмотров 118 тыс.
iOS Developer Mock Interview | Tech Round (Round-2)
31:37
Swift: Dependency Injection Tutorial (2022) - iOS
24:31
Swift: How to Migrate MVC to MVVM & Intro Unit Testing
33:11
How to use the Coordinator pattern in iOS
18:12
Просмотров 71 тыс.
СМАЗАЛ ДВЕРЬ
00:31
Просмотров 161 тыс.