This is by far the most understandable explanation of MVVM out there. All the other resources tries to overkill the architecture and focuses on creating the MVVM structure for the sake of creating the structure, not for the efficiency. Shout out to the brodie.
@ZoepX6 жыл бұрын
iOS Architecture topics are greatly appreciated! Thank you. Viper in the future, perhaps?
@anapauladesousa57015 жыл бұрын
Wow! This is actually one of the best programming tutorials I've ever seen! I've been searching and studying for a while about MVVM on iOS and this was so straightforward and easy to follow (not to mention the test implementation part 👌🏻). Thank you so much for your effort and keep up the good work 😊
@Omeir346 жыл бұрын
A much needed video from Brian about MVVM
@gushiciaihaozhe5 жыл бұрын
Hi Brian, I am working on a contract with MVVM. Your video saved my life again! Thanks again for all your hard work!!!
@alcprado5 жыл бұрын
Alright so I was looking for a MVC to MVVM implementation tutorial and found yours, opened the video and for my surprise, the video already had my thumbs up, which disappointed me as I wanted to do it again. Brilliant as usual Brian. Ty
@rdsinchd5 жыл бұрын
Hi, Its a very nice tutorial, very informative, Thank you very much. Just a small question about adding the UIKit in the viewmodel. I thinks view model should not have UIkit imported because. View model is just a way with which data will be shown on the view. View controller owns the view model and controller is responsible for managing the UIKit components. May be adding an enum for the properties in the viewmodel and changing the accessory type according to the enum would have been a much better. Rest the tutorial is awesome.
@amari97733 жыл бұрын
This greatly assisted me in technical interviews.
@midnytromeo6 жыл бұрын
Watched so many videos on this, but the way you explain things I'm very excited for this 🔥
@HamzaKhan-xo7dv5 жыл бұрын
U made it so easy. I am usually a silent watcher but this video made me comment. Thank you for such a nice tutorial.
@ivanputeraa5 жыл бұрын
Great video for beginners to migrate their app from MVC to MVVM architecture! Thanks
@-engin70334 жыл бұрын
Thank you. Why do you use fileprivate for fetchData() but not private since its inside the class?
@hinocenciopaulo6 жыл бұрын
Brian, first of all, excellent introduction about MVVM and the importance of this architecture for a good unit test. Hope to see you talk about UI testing soon, but I want to know your opinion about rxSwift/rxCocoa. What do you think about this libraries? Do you plan to start some courses about reactive programming?
@ALHeLaLe3572 жыл бұрын
Thanks for the video man it cleared the differences for me I wanna know in 8:20 is Dependency Injection and Constructor generally the same thing? or is there a difference?
@disorderedenthropy6 жыл бұрын
Great video as usual. Quick question: I didn't see you do any binding, which seems to be common in MVVM. How does the view know to update itself without observing the VM?
@kav046 жыл бұрын
Hi Brian are you going to bind data using pattern via clousers ? What about bidirectional binding ?
@steverobertson27326 жыл бұрын
Well, done. The MVVM explanation was helpful and I liked the intro to testing.
@vonvision5 жыл бұрын
Totally awesome! I was looking for some Swift patterns to refactor some app -- and this video helped me a lot! Have a great day, Mike Wolfram
@chudq6 жыл бұрын
Nice video and easy explanation on Unit test. I have never done this in iOS projects, but I did this kind test in C# projects. Therefore it is not so hard to pick it up. Thank you!
@liramvahadi98043 жыл бұрын
Wow excellent!!! I’ve to answer viewModel allow to import uiKit?
@laiqueahmed66136 жыл бұрын
Wow thanks a lot Brian . Such an important topic this one for young developers like us.
@cinquain05 жыл бұрын
One of Brian's best videos.
@cdrman6 жыл бұрын
Hello! Why do not you use the dependency injection design pattern with the Service? Thank you very much.
@Nell15 жыл бұрын
Let's go start recording video like "MVVM to VIPER" :D I will wait this))
@gaurangbham56402 жыл бұрын
Hi Brian, been a huge fan of your videos ever since I decided to learn Swift all the way back in 2017. I know this video is a bit old but I've been really honing in on understand design patterns a little better and I did had a question about one of the points you made. For this specific example you imported UIKit in the ViewModel class which I have heard conflicting things on. Some resources mention that the ViewModel class should not be touching any code involving the UI to keep it decoupled. In this specific case, its kind of understandable since we need the ViewModel logic to set the UITableView Asset and I can't think of another way that would result in us needlessly adding logic to the view itself that should definitely be in the ViewModel class. I just wanted to get your take on this
@oalansari6 жыл бұрын
Nice one .. I was about to propose unit testing when I saw your previous interview with Sean Allen. I think it would be useful if you go through unit testing in details. Maybe take your Instagram App that built in your course and do a full unit testing course around it? Just a thought Keep going bro
@gouen955 жыл бұрын
Hi Brian, thanks for the walkthrough. But I've a few question to ask.. 1) It is correct to store a copy of Course data returned from the service in CoursesViewController? 2) I noticed that CourseViewModel is saved as an array in CoursesViewController. Thus CoursesViewController is able to access all the variables in CourseViewModel such as accesoryType or detailTextString. Won't that cause confusion? 3) Other than abstracting the model by using ViewModel and massaging the data in ViewModel, is there any other feature/functions that should be done by only ViewModel?
@gouen955 жыл бұрын
@Lets Build That App , I need some advice thank you :D
@kelvinfok5 жыл бұрын
Hi Brian, one of the best videos in your channel. Really hope you can make a paid tutorial on building an app with unit test and UI test.
@nicodioso5 жыл бұрын
I hope you read this mr Brian, how would this be implemented using your LBTAComponents?
@saeedhajizadeh55526 жыл бұрын
Thanks for the awesome tutorials.I had a question. So if i'm going to start a new app in which i implement 'TDD' , is 'MVVM' the architecture to use? or are there any better architectures?
@nebulousJames123453 жыл бұрын
I would personally use MVVM! But if I were to use a different architecture, it would be VIPER
@amdsy09974 жыл бұрын
Thank you so much! Great Tutorial A quick question: Should the ViewModel be stored inside the cell ? What about setting the needed properties using a method instead of storing it ?
@rickisyourbro6 жыл бұрын
Hey Brian! Nice video. I really learn a lot from you. Please keep this going! Thanks man
@vandanpatel40936 жыл бұрын
I have been struggling with MVVM for last almost 3 months. As soon as I read the title, I liked the video, because when brian explains something, you know you go it. Is there anyway we can get the starter project and code alongside you?
@LetsBuildThatApp6 жыл бұрын
Great, mvvm is a really deep topic and we barely scratched he surface with this video. You can download all the code using the link in the description. Maybe I’ll put up starter projects in future lessons.
@vandanpatel40936 жыл бұрын
That would be really great if you can put up starter project in the future. I really love to code alongside to have the better understanding. Thanks!
@pyaephyoaf6 жыл бұрын
Vandan Patel I’m with you
@MaZeModding6 жыл бұрын
Could you go a little bit deeper to MVVM? Now I know how to read data from the model but how can I save things from the view in a model? BTW I love your videos! 2 Days ago I was thinking "Wouldn't it be nice if he makes a video about MVVM?" And now you did one!
@elevateEdAssam2 жыл бұрын
@@LetsBuildThatAppSir I am not getting any data from Service file from the demo project . The app just opens with Nav bar and body background. Table with data are not displaying
@gbu854 жыл бұрын
Simple and clear. I appreciate your effort.
@akhilgupta68835 жыл бұрын
Explained simply as always. Thanks a lot.
@巴貝里奇4 жыл бұрын
In 29:56 This is the advantage of "Dependency Injection" We can create model and modify the property to test the logic in our ViewModel
@sandhun14 жыл бұрын
Hi Brian can you explain how to handle a scenario where there are multiple API calls In same View, are we supposed to create multiple modelViews one for each api
@theJeraldo76 жыл бұрын
Great tutorial. I've been using MVVM a lot lately, and still I got a lot of tips to improve my MVVM from this tutorial. Do you have plans on doing a VIPER tutorial?
@rogerwprice5 жыл бұрын
Thanks - what a super useful and clear explanation of two key topics!
@firstjamesryu2 жыл бұрын
Congratulations on 200K-subscriber milestone.
@LetsBuildThatApp2 жыл бұрын
Seems like an eternity ago when you left your first comment James.
@firstjamesryu2 жыл бұрын
@@LetsBuildThatApp You remember when I first commented? That’s an honour! I don’t know what I commented though. :)
@firstjamesryu2 жыл бұрын
Regarding Fullstack Social iOS NodeJS REST course, is the backend for iOS app Amplify?
@LetsBuildThatApp2 жыл бұрын
@@firstjamesryu it uses sailsmvc very similar to express nodejs
@firstjamesryu2 жыл бұрын
@@LetsBuildThatApp My understanding was that sailsmvc was for web app. What about the iOS app of that course? Doesn't that use AWS? I thought I saw AWS somewhere. I am trying to confirm it because I want to learn to get familar with AWS and I want to buy that course if that is the case.
@guruslakkimar125 жыл бұрын
Thank - you for your videos = highly recommended....... I have an issue if can help me please,, how do i back up my database contents entered from the UI (like phone numbers, information and contacts) and later when i implement another software ....... I should be able to extract the same contents in the database and use it for coding again, because my content remains same ...... I wish to also print the same contents in a PDF file in a particular desired format ..... cheers buddy ......
@atrcl956 жыл бұрын
More MVVM and RxSwift videos please :)
@AhmdIsmail5 жыл бұрын
That was awesome! It's just what I've been searching for. Thank you so much, Brian :)
@MrPaulHuynh6 жыл бұрын
Brian, you're the best. Really appreciate your videos!
@theJeraldo75 жыл бұрын
Thanks for the great example. I've started unit and ui testing in my projects. One question I have though is our manager is saying that the code coverage should at least be 80%. I am wondering if this is the norm in other teams and companies as well. I could not get my unit test to above 50% as I do a lot of private methods. Plus, some codes like required init?(coder aDecoder: NSCoder) are not really called from my tests but is required by Xcode.
@rhenzzee4 жыл бұрын
Isn't it a bad practice to make you UITableViewCell(CourseCell) accept `Model Object` to configure itself?
@seanlin25516 жыл бұрын
So excited to watch this video =D Thank you so much, Brian !
@anandyadav29036 жыл бұрын
Hi Brian, Can you provide a comparison between MacBook pro vs MacBook air for xcode development as I am planning to buy one and am pretty confused 🤔
@yassinmziya27335 жыл бұрын
Really important topics. Gr9 stuff!
@fabiolaramirez22386 жыл бұрын
Thank you so much for this video! this architecture pattern is really useful to know.
@NathanMartins6 жыл бұрын
Really nice overview for MVVM. Could you make one video talking about RxSwift? Do you use it on your projects?
@lianahaque25125 жыл бұрын
This was really good - will there be more tutorials in the future about other architecture patterns?
@david-tracy5 жыл бұрын
You did a great job teaching this
@andreiamza1846 жыл бұрын
Awesommeeeee! i have waited for this video for such a long time =)
@ChrisKeLLs20106 жыл бұрын
Can anyone explain how MVVM works when you need access to the model objects? The example used in the video seems to be based on simply displaying the table, but what would need to happen after a row is selected. Would you just have an id property on the model? At that point would it make sense to just give the model object to the table cells instead? Im late to the party on this video, just discovered this channel its dope af!
@ngoai30505 жыл бұрын
Thanks Brain, That's just what I've been searching for.
@sunilaruru92576 жыл бұрын
Hi Brain , I really like all your tutorials and the way explained is awesome. Can you please prepare a class for dependency injection ?
@Rajubd496 жыл бұрын
Thanks for your awesome video. How about a video "How to Migrate MVVM to MVVMC"?
@CarlosGrossi6 жыл бұрын
Could you please do a video like this on VIPER design pattern? Great video btw!
@vladislavsimovic8996 жыл бұрын
Very nice, keep up the good work!
@chandukonduru28816 жыл бұрын
Asusual amazing stuff Brian.. Keep going!!
@MyAdriSilva6 жыл бұрын
Hey Brian, first of all thanks 🙏 for this kind of videos, I learn a lot with them! 🔥 There is a conference talk of a former Apple iOS engineer saying that ViewControllers in MVC are Views and not Controllers. What are your thoughts on that? You seem to use them as Controllers or a hybrid between Views and Controllers. Thank you so much for your time 😄
@JLCodes2 жыл бұрын
I don’t agree that ViewControllers in MVC are Views. ViewControllers are Controllers in MVC and it’s an intermediary between Models and Views.
@ManuelSalinasMxnuelsg6 жыл бұрын
Whats is the difference with MVP? Could you show us too?
@arturmavlyuchenko76476 жыл бұрын
But 32 is 30+ what the... 😂😂😂. Thanks for the tutorial. It is great when you are subscribed to someone and watch every other videos coming out and there are some topics that you do not force yourself to introduce into because of some stuff that is in his (mine) opinion is higher-priority, so you really help me to acquaint with some topics that I always put off
@LetsBuildThatApp6 жыл бұрын
I realized this while I was editing the video, hopefully people can figure out what I was trying to do with the 35 value.
@akshaygawade2725 жыл бұрын
why do you use struct for viewmodel
@amrzayed45456 жыл бұрын
what is the best in ios MVVM or MVP?
@ayon35276 жыл бұрын
Tx a lot for this amazing and simple yet powerful lesson
@dosbol3546 жыл бұрын
Liking from two accounts, so much useful and cool stuff! I love it, thinking about buying some of your course >
@altynbek635 жыл бұрын
Where a u from Dosbol?
@kelvinyusuf66584 жыл бұрын
What is [course]()? Its equal with a = new Course()? But with list of array Course?
@alpiopiopiond6 жыл бұрын
On your example ViewModel is related to Model, but some project ViewModel is related to ViewController or view page
@hotskyakash3 жыл бұрын
Thanks Brian its very helpful
@jeffa.23786 жыл бұрын
Fantastic !! Thanks Brian.
@xfabiosoft6 жыл бұрын
What about mvvm and its two way binding? Can you make an example?
@arifinfirdaus73796 жыл бұрын
Hi Brian, nice video! Would you like to make video for GCD? I think it's a good topic for more advance content
@behran6 жыл бұрын
thank you! Maybe you may talk about how to achieve smooth scrolling for tableview or collectionview on next videos!
@odduser16346 жыл бұрын
I have a problem with swift autocomplete, plz help. Xcode 9.2 swift 4 project with few objective C code, 95% swift code, but app has 10 different Targets. My issue is swift autocomplete do not work at all, like at all. Not even restart works. I have tried the usual methods like clear DerivedData, clean, folder clean, restart but its not working. In other small projects with one or two targets, swift autocomplete works just fine, this one don't. Any help is appreciated.
@hasanozanal74174 жыл бұрын
Hi Sir, You imported UIKit in the viewModel struct but Don't we want to separate the user interface from viewModel? I think Viewmodel should do the logic and just tell the ui "here is your informations", by doing so, we follow the solid principle.
@LetsBuildThatApp4 жыл бұрын
It’s all up to you.
@hasanozanal74174 жыл бұрын
@@LetsBuildThatApp Thanks for the answer sir. Love your work btw
@bureaucraticfelcher83574 жыл бұрын
Great basic example. But MVVM is still not a good pattern as there is no strict guideline/template on what a viewmodel must and must not contain. A good example is importing of UIKit inside the ViewModel. That is why a lot people will mention about Clean Coding/VIP/VIPER.
@КристианБенуа6 жыл бұрын
Can you make a course, where you will use MVVM? It would be great!
@brothercaleb3 жыл бұрын
17:55 unit testing You’re welcome
@SouravSantraprofile6 жыл бұрын
Hi , I have a project where I have take pictures of keys attached with room and have to map those with the room no and later on when someone takes picture of a key, I have to show corresponding room no. I have briefly seen ARKit, Vision, Object detection, but I’m still confused, how to achieve that bcoz it’s not only objective detection, furthermore I have to track the differences between the keys 🔑 . please help me .
@lmfao72246 жыл бұрын
I personally use VIPER, it’s my favourit
@TheRealWilcox6 жыл бұрын
Could you do a video on how to edit a users profile information with fire base? It could be an add on to the firebase chat app?? I’m fairly new to swift and I have been following your videos since I started!
@alexr3d6 жыл бұрын
We want more unit testing videos :)
@MrMaverick09276 жыл бұрын
Hi Brain, I have been watching and following your Create KZbin App tutorials. I was able to recreate that in Xcode 9 with swift 4. The only problem I am having right now is the collection view cells that were placed inside of the collection view controller for vertical scrolling are not expanding to the full width of the frame in landscape. There is no option to use willTransition on UICollectionViewCell. So I am kind of stuck at that point for now. Any help would be much appreciated. Thank you.
@LetsBuildThatApp6 жыл бұрын
You have to go inside your cells and reload the collection view manually on rotation: cell.collectionView.reloadData() // on rotation after will transition
@MrMaverick09276 жыл бұрын
Thank you for the reply. I tried doing something like this and it doesn't seem to work. I used this code in the HomeController Class let cell = FeedCell() override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) { coordinator.animate(alongsideTransition: { (_) in self.collectionViewLayout.invalidateLayout() self.cell.collectionView.reloadData() }) { (_) in } }
@LetsBuildThatApp6 жыл бұрын
Yeah you probably want to learn the basics of how UICollectionView dequeues cell before moving on here.
@MrMaverick09276 жыл бұрын
yes. I was thinking about buying your instagram firebase course. waiting for a payment check to clear. was going through your tutorials in the mean time.
@srinivasanmohan64856 жыл бұрын
Many Thanks for this tutor. Unit test was móre fun.
@CaffieneToCode5 жыл бұрын
We do not male service calls in controller when using MVVM, this is not MVVM Brian, all it does is create an alternative array to courses. Pure MVVM would be ceeating an array of ViewModela so that it fethes its data upon its initilization and returns a fully initialized ViewModel
@david-tracy5 жыл бұрын
Great job
@niteshkhandal52636 жыл бұрын
Can you please explain that how you create service.swift file with hold some data?
@kav046 жыл бұрын
I did MVVM like that : - AllCoursesViewModel keeps all the courses - [Course]. So CourseViewModel is a wrapper around [Course]. Regarding of details of one Course I get to use CourseViewModel that is a wrapper around Course. But my notion of ViewModel was not clear but rather pretty obscure, so I did not get what shoud be abstarcted to VM
@vole10526 жыл бұрын
Why would I move to MVVM from MVC(most popular)?
@RippleClips4 жыл бұрын
Is it just me or should detailTextLabel?.text = "Lessons 36+ Check it Out!"? *Sorry, my background is in testing*
@kawe51045 жыл бұрын
Man that was great! Thanks a lot.
@sikfreeze6 жыл бұрын
Very useful. Thank you
@moosegoose12826 жыл бұрын
my first time seeing someone use the built in properties of tableview: detailText etc.. are the constraints for them already set in a default position?
@LetsBuildThatApp6 жыл бұрын
Yes they just show up if you set text on them. For the detail label you have to initialize a subtitle cell.
@justinji2316 жыл бұрын
Thanks Brian!
@dudestalk6 жыл бұрын
go for clean architecture brian... i think developers really need it...
@kirtiparghi48375 жыл бұрын
Can you please upload video for Dependency Injection?
@mike_zander4 жыл бұрын
Wouldn't you want to have [weak self] in your network completion block since you're refrencing self??
@LetsBuildThatApp4 жыл бұрын
Yes, you should avoid self retain cycles if you use view model objects.
@mike_zander4 жыл бұрын
Lets Build That App got it, thanks!
@MrPappu905 жыл бұрын
Could you help me to migrate MVC to VIPER with Testing