iOS 15: Introducing MVVM into your SwiftUI project - Bucket List SwiftUI Tutorial 11/12

  Рет қаралды 24,697

Paul Hudson

Paul Hudson

2 жыл бұрын

Download the completed project here: github.com/twostraws/hackingw...
Other parts in Project 14:
Introduction: www.hackingwithswift.com/book...
1. Adding conformance to Comparable for custom types: • iOS 15: Adding conform...
2. Writing data to the documents directory: • iOS 15: Writing data t...
3. Switching view states with enums: • iOS 15: Switching view...
4. Integrating MapKit with SwiftUI: • iOS 15: Integrating Ma...
5. Using Touch ID and Face ID with SwiftUI: • iOS 15: Using Touch ID...
6. Adding user locations to a map: • iOS 15: Adding user lo...
7. Improving our map annotations: • iOS 15: Improving our ...
8. Selecting and editing map annotations: • iOS15: Selecting and e...
9. Downloading data from Wikipedia: • iOS 15: Downloading da...
10. Sorting Wikipedia results: • iOS 15: Sorting Wikipe...
11. Introducing MVVM into your SwiftUI project: This video
12. Locking our UI behind Face ID: • iOS 15: Locking our UI...
Wrap up and challenges: www.hackingwithswift.com/book...
You can find the full set of videos, along with transcriptions, challenges, tests, and more, in my free 100 Days of SwiftUI course: www.hackingwithswift.com/100/...
Watch the full 100 Days of SwiftUI playlist here: • Hacking with iOS: Swif...

Пікірлер: 22
@shim2dawg
@shim2dawg 10 ай бұрын
Thank you for stating MVVM is a terrible name. I have always been confused by it and it's nice to be validated.
@carlsmith358
@carlsmith358 11 ай бұрын
This video really improved my understanding of how to use MVVM in SwiftUI, along with the benefits it has.
@HaraldSchubert
@HaraldSchubert 2 жыл бұрын
Perfect explanation of MVVM and application to SwiftUI!
@acjazz01
@acjazz01 2 жыл бұрын
You've created a wrong connection between ViewModel and ContentView by putting the VM inside of an extension of the ContentView, and actually MVVM says that the ViewModel must be agnostic, as it can be used in any view.
@jamesm.6874
@jamesm.6874 Жыл бұрын
You are an excellent teacher, thank you so much!
@shotaworld
@shotaworld 2 жыл бұрын
Great video! Could you make a video about the redux pattern? For example, the store, actions, reducers and dispatch. Thanks!
@igorsevtsenko655
@igorsevtsenko655 2 жыл бұрын
Hi. Could you make please video about VIPER with SwiftUI. Very interesting to watch how can we use protocols for modules connections and SwiftUI property wrappers
@maple3226
@maple3226 2 жыл бұрын
I'm having a warning when I'm declaring the viewModel variable saying "Expression requiring global actor 'MainActor' cannot appear in default-value expression of property '_viewModel'; this is an error in Swift 6". Is there a different approach to remove this warning?
@mykytakhlamov
@mykytakhlamov Жыл бұрын
Thank for this video and your work! I have one question: How to proper test this ViewModel via UnitTesting?
@rileybarabash221
@rileybarabash221 2 жыл бұрын
Since we're migrating our logic from structs into classes, doesn't this have a negative affect on performance?
@ConfidentlyRong-jo5yt
@ConfidentlyRong-jo5yt 25 күн бұрын
I've been seeing a lot of videos about how MVVM isn't ideal in SwifUI. Paul, could you please clear this up for me? I'm just starting out with SwiftUI, should I learn MVVM?
@JeffreyConcerto
@JeffreyConcerto 2 жыл бұрын
Paul, why is it better to save the data via documents directory here instead of using CoreData?
@Ipat639
@Ipat639 11 ай бұрын
I am struggling with binding viewModel's private(set) var string and ContentView's TextField, any idea?
@tinkering.online2007
@tinkering.online2007 2 жыл бұрын
I think someone should file a bug for that disappearing of the file contents :-) But XCode gets angry at me too sometimes.
@RajeshSharmaIndia
@RajeshSharmaIndia Жыл бұрын
View model is an independent component which should not have any information regarding views, by creating the view model class inside the view extension we are encapsulating the view model class which is resulting in tight Coupling. What problem are you solving by creating the view model class inside view extension?
@twostraws
@twostraws Жыл бұрын
I’m struggling to find the inclination to reply to this level of rudeness, however I will at least say this: you’re facing a problem known as Chesterton’s Fence, and might want to take a little more time to think before posting these sorts of comments.
@RajeshSharmaIndia
@RajeshSharmaIndia Жыл бұрын
With a very polite manner I am saying that I learned so many thing from your video and article , but at some point if I have doubt in something or I found its not a good way to do the thing, so its no harm that creater accept i did wrong or if you didn't ,so you had to explain the reason why you choose that approach. Lots of people followed you and apply the approach in projects . i hope you didn't find the truth is rude.
@Ipat639
@Ipat639 11 ай бұрын
it is not tight coupling, it is a reminder that this view model normally should be used with this view. And it is a class declaration not a concrete object, you can instantiate it and use where you want to use.
@obelix8477
@obelix8477 2 жыл бұрын
MVVM is not an acronym. Acronyms are pronounced like words. Think radar, ASCII, modem. MVVM is an abbreviation. Probably a greek or latin base somewhere in there. Also, if your fans are confused with "belts and braces" they may know braces as suspenders. This is an analogy for the parts that hold your program together. They keep the "pants up" so to speak. But this means using two ways to ensure your pants don't fall down.
@prashank
@prashank 2 жыл бұрын
Ty Mr. Doggo
Советы на всё лето 4 @postworkllc
00:23
История одного вокалиста
Рет қаралды 4,5 МЛН
Smart Sigma Kid #funny #sigma #memes
00:26
CRAZY GREAPA
Рет қаралды 6 МЛН
Получилось у Миланы?😂
00:13
ХАБИБ
Рет қаралды 5 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 11 МЛН
5 Steps to Better SwiftUI Views
31:19
Paul Hudson
Рет қаралды 55 М.
The Last SwiftData Tutorial You Will Ever Need
1:09:25
Rebeloper - Rebel Developer
Рет қаралды 5 М.
8 Common SwiftUI Mistakes - and how to fix them!
28:05
Paul Hudson
Рет қаралды 49 М.
JPEG is Dying - And that's a bad thing
8:09
2kliksphilip
Рет қаралды 78 М.
How to use the Coordinator pattern in iOS
18:12
Paul Hudson
Рет қаралды 71 М.
SwiftUI List with Custom Cell & Passing Data
36:27
Sean Allen
Рет қаралды 115 М.
How To Work With Any API (API Tutorial using URL Requests)
27:07
CodeWithChris
Рет қаралды 124 М.
NavigationStack - SwiftUI Programmatic Navigation - iOS 16
20:20
Yanlışlıkla Telefonumu Parçaladım!😱
0:18
Safak Novruz
Рет қаралды 985 М.
Tag him😳💕 #miniphone #iphone #samsung #smartphone #fy
0:11
Pockify™
Рет қаралды 4,6 МЛН
Как бесплатно замутить iphone 15 pro max
0:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 8 МЛН