This is the only basic mvvm tutorial for beginners and believe me I searched all the internet in different languages, thanks man this helped me a lot, keep doing it 👍
@logankoshenka3 жыл бұрын
Great to hear :) Thank you!!!
@Ikemo42 жыл бұрын
Retweet
@logankoshenka2 жыл бұрын
Love hearing that
@williams.7314 Жыл бұрын
Thank you. I come from a .NET background with desktop publishing, so I was looking for an MVVM tutorial. So. Many. People. don't understand well enough to explain it well. That being said, as the rest of the comments suggest, well done sir, well done. Exactly what I needed.
@logankoshenka Жыл бұрын
thank you!!
@DmitriyChurilov Жыл бұрын
Great introduction into the concept. Thank you!
@SantiLucero098 Жыл бұрын
Very clear and simple, thank you man!
@logankoshenka Жыл бұрын
💪
@jamesmeegan2066 Жыл бұрын
That was great, exactly what I needed and simple to understand.
@logankoshenka Жыл бұрын
love it - thanks for watching!
@TidalWaveDan Жыл бұрын
You sir, had by far the most understandable video in the subject. Thank you. I will be subscribing and recommending your channel to others trying to learn.
@logankoshenka Жыл бұрын
I appreciate that, glad you liked it!
@joaquimmenezes739610 ай бұрын
this tutorial was so cool, i understood concepts better ....
@logankoshenka10 ай бұрын
great!!
@MrDaluti Жыл бұрын
Very well explained, thank you Sir, simple but effective. Please keep up the good work. 👏
@logankoshenka Жыл бұрын
means a lot - thank you!
@AntiSmithhh2 жыл бұрын
ObservedObject occasionally works sometime. sometime doesn't and shouldn't. It should be StateObject in all similar cases. As for me, it's very clearly described in apple documentation.
@logankoshenka2 жыл бұрын
really?
@AntiSmithhh2 жыл бұрын
@@logankoshenka really! If I'm right, ObservedObject is like 'weak' reference and StateObject is like 'strong' one. But wrapper implementation keeps object alive in some cases when we are using ObservedObject. So using ObservedObect instead StateObject doesn't lead crushes and problem just stay hidden in simple cases. P.S.: thank you for MVVM example.
@logankoshenka2 жыл бұрын
Ahhh that makes sense - thank you for this!
@ob62172 жыл бұрын
ur light-mode just mademy day brighter and eyes darker😜 btw, thanks a lot sensei 🤝
@logankoshenka2 жыл бұрын
hahaha thanks for watching
@glennmiller3942 жыл бұрын
I get it now. Well done.
@logankoshenka2 жыл бұрын
thanks for watching!
@SOK-gn6hw2 жыл бұрын
How can I change the array with a button. like if Jon Snow change his email and wanna change this in app how can I do that ?
@goisborges Жыл бұрын
Amazing tutorial
@logankoshenka Жыл бұрын
thank you!
@ob62172 жыл бұрын
i wanna ask something, where are those function come from? the people.reverse and the others.. i dont see it.. mind to explain, please??
@ob62172 жыл бұрын
ah i get it rn, thank youu
@dmitrygolovin80663 жыл бұрын
Nice man! Thanks for all the great content
@logankoshenka3 жыл бұрын
my guy I appreciate it 🤘🏼
@alexdiaz17122 жыл бұрын
This is exactly what I was looking for! Thank you for making this awesome video and making me laugh 😂
@logankoshenka2 жыл бұрын
haha glad you like it - welcome!
@georgeikwegbu52842 жыл бұрын
For real, I laughed all through, now I have to rewatch it again 😩🤣🤣🤣🤣, nice tutorial Logan, thanks
@kevindesouza6143 Жыл бұрын
At 5:30 timestamp, you add the ObservableObject Protocol. Using Swift 5 and Xcode 14.1 I get an error there. Basically it wants to add a Generic Type to the Observable object.When I add it says this is not confirm to ObservableOBject Protocol. Can't proceed further till this is resolved. So pls help. Also I get an error when I use the Identifiable Protocol.
@logankoshenka Жыл бұрын
hmm, I wonder if this could be related to Swift versions? If I find an answer I'll reply in this thread.
@johnpill1 Жыл бұрын
How would you use this approach to access the same data across multiple views, do you require the environment object at that point?
@logankoshenka Жыл бұрын
yeah I think environment object is your best bet for that … check out the tutorials that tundsdev has on this, really helpful stuff 💪
@johnpill1 Жыл бұрын
@@logankoshenka I've actually been using the tutorial you mention, but wondered if there was a simpler way!
@mattmarshall18342 жыл бұрын
Great tutorial. To the point.
@logankoshenka2 жыл бұрын
thanks!
@anhhanry71672 жыл бұрын
HI, just learn of this mvvm model based on @observable object, this is new to me, thanks for the tutorial... but I need to goto detail view if I tap/click on each view model, could you help ? (pointing to which info to pass ) because I don't know how to pass data ( each of model ) to the detail view model ( how to declare variable) , thanks
@logankoshenka2 жыл бұрын
Glad it was helpful! I'm not sure I understand what you mean - could you elaborate?
@anhhanry71672 жыл бұрын
@@logankoshenka for example > each person ( in the List) if click, I need to display a next screen ( a detail view ) to display more information ( such as a photo, title, salary, department etc..of the person ) theerefore I need to pass the object into this new view meaning the new detail view would require the correct person ( information of object) to display. I would design the new view but I need the info of the person from previous screen which tie to @Observableobject.
@DaveJacobseniOS3 жыл бұрын
I couldn’t follow any of this because my eyes were damaged from light mode. Jk, this is solid stuff and a great refresher for me👌
@logankoshenka3 жыл бұрын
hahaha hey you're talking to a fellow member of team dark mode so I get it 😅 thank ya
@ForhadDreams2 жыл бұрын
Great example!. can you please a short MVVC video tutorial for fetching API data CRUD[create, get, update, delete]? Please.....
@logankoshenka2 жыл бұрын
Thanks for the suggestion! You may have a typo - it's typically MVVM or MVC.
@ForhadDreams2 жыл бұрын
@@logankoshenka oh! sorry. it's MVVM. Please. :)
@logankoshenka2 жыл бұрын
@@ForhadDreams gotcha!
@ForhadDreams2 жыл бұрын
@@logankoshenka thanks. Hope we will get it soon!
@arturoescutialopez1900 Жыл бұрын
Nice video. I´m just wondering, is there a reason for ViewModel to be a class and not a struct? you could use @State in the view make viewmodel a struct and handle inheritance with protocols if needed. Why would you need a reference to the viewmodel and not a copy of its values?
@logankoshenka Жыл бұрын
In the case that we're using the viewModel in more than one place, I would want all references to be updated. That's the main reason for using a class in this scenario.
@deiv319x8 ай бұрын
I love the subtle satire 😂😂
@logankoshenka8 ай бұрын
😄 thank ya
@chingshenchen2 жыл бұрын
Thank you for sharing. I have subscribed your channel. Keep doing it. :)
@logankoshenka2 жыл бұрын
Thank you so much! More videos coming soon :)
@tarun_reddy3 жыл бұрын
Thanks for this king
@logankoshenka3 жыл бұрын
🤝
@tharindudarshana64802 жыл бұрын
Great tutorial. Thank you
@logankoshenka2 жыл бұрын
Thank you!
@TheShambi Жыл бұрын
Hi, wouldn't it make more sense to have the people array inside a model and not the viewModel. let's say you have different sets of potential People array. The viewModel will load them in the constructor based on the array you want. What I mean is that the viewModel should have the possibility to load a lot of different models and not include hard coded values?
@logankoshenka Жыл бұрын
yeah I see what you're saying ... with different sets of people, it'd definitely make sense for that data to be available inside of a model.
@franziskaschneider86062 жыл бұрын
Finally a simple example and not unnecessarily complicated. Thanks! I experimented a bit with the code. The array is updated in the view, but if I change the name of a person, the view is not updated. What do I have to do to make this data binding work?
@logankoshenka2 жыл бұрын
Thank you! And just to be clear, are you changing the name of a person in code or while running the app?
@franziskaschneider86062 жыл бұрын
during runtime -> In the PersonViewModel class I added a renameFirstPerson() func.
@logankoshenka2 жыл бұрын
@@franziskaschneider8606 do you mind sharing that function here? I’ll gladly take a look!
@edgarhernandez653 жыл бұрын
thanks, great video. I would love for you to make an example by consuming an api Saludos desde México
@logankoshenka3 жыл бұрын
Muchas gracias!
@tokero5199 Жыл бұрын
Thank you for the explanation, I'm not a fan of you importing SwiftUI in the model and the viewModel, you really should keep those UI agnostic.
@logankoshenka Жыл бұрын
ah good point, thanks for the feedback 🤝
@myga773 жыл бұрын
Show us how to create custom swipes with your scrollview list, not with the regular list in SwiftUI I can't figure out how to find the index of each cell in a scrollView
@logankoshenka3 жыл бұрын
custom swipe actions like horizontally?
@thedrenkemp1242 жыл бұрын
Would you ever make a video on custom keyboard? How to create custom keyboard?
@logankoshenka2 жыл бұрын
I’ll look into it!
3 жыл бұрын
Thanks Logan ;)
@logankoshenka3 жыл бұрын
Of course!
@thirashapw3 жыл бұрын
Love it. Keep doing ❤️
@logankoshenka3 жыл бұрын
thank you!
@Danyil-ip3ll2 жыл бұрын
Thank you.Make more videos!!!!Hello from Ukraine 🇺🇦
@logankoshenka2 жыл бұрын
more coming soon!
@WilfClegg2 жыл бұрын
Thank you for this video, Logan! This makes it very simple to understand the MVVM SwiftUI structure. Other videos seem to confuse the basics because of other processing features (which only serve to conflate the basic MVVM method). I tried adding an array sort, to sort the array by name. I can't seem to get it to work. I don't understand how this simple addition can be so complicated. Is there any advice you might be able to share? Thanks!
@logankoshenka2 жыл бұрын
Thank you, glad you liked it! Where are you calling the sort method?
@izzzanaaami2 жыл бұрын
I live in Russia, and I've watched so many video tutorials and courses about it, but most of them are useless because their authors themselves didn't fully understand what they were doing, or they have very little experience, in general, thanks from Russia
@logankoshenka2 жыл бұрын
thanks for watching!
@followerOfJesus723 Жыл бұрын
I'm sorry to be the spoil-sport/negative Nancy but, there are tons of videos that show this. Use an actual Networking Service that actually makes an API call. Then show how to create a dependency manager so you don't make the service in the ViewModel. When you declare the viewModel in the View, it should be optional and not initialized. Then use a dependency provider to initialize it, (possibly in the scene or app delegate or whatever) but the responsibility for initializing the service should not be delegated to the view. That isn't MVVM.
@logankoshenka Жыл бұрын
I appreciate the feedback! I’m always doing my best with what I know, and this video specifically was meant to be as simple as possible. You should make a video demonstrating this! I’d love to see it in action 🤝