Performing Network Operations Using MV State Pattern in SwiftUI

  Рет қаралды 2,290

azamsharp

azamsharp

2 жыл бұрын

In this video, Mohammad Azam will demonstrate how to perform network operations using the MV State Pattern in SwiftUI.
GitHub: github.com/azamsharp/MoviesAp...
#iosdev #swiftui #iosdeveloper
Check out all of my courses:
azamsharp.com/courses Check out my courses at
azamsharp.school/

Пікірлер: 15
@scriptedpixelsltd
@scriptedpixelsltd 2 ай бұрын
This was really useful! I'm picking up some SwiftUI as a front-end web developer and this feels just like how the new JS frameworks are being built for Single Page Apps. I use Services, Stores and etc in my Vue.js apps. Would be great to see how you would create a CRUD application
@vanylaskywalker
@vanylaskywalker Жыл бұрын
Why did you create two instances of Store, one in ContentView and one in its child MovieDetailView? Wouldn't that mean you duplicated the stores and have two sources of truth?
@scriptedpixelsltd
@scriptedpixelsltd 2 ай бұрын
Just watched the whole video and I don't see where he created 2 instances of the store? (new to learning SwiftUI and looking for clarification on what was wrong here)
@vanylaskywalker
@vanylaskywalker 2 ай бұрын
@@scriptedpixelsltd Could you show that they are the same store? (Looking for clarification too)
@redhotbits
@redhotbits 10 ай бұрын
why store? it does fetching and storing, why not store data in @State directly?
@findthebug
@findthebug Жыл бұрын
Thanks❤
@judy8821
@judy8821 Жыл бұрын
Nice
@hamslammula6182
@hamslammula6182 2 жыл бұрын
Thank you Mohammad for the video. There is a problem however, data flow is only going one way - from the Model to the View. This isn’t a problem for hobby apps like the ones apple uses for demonstration but for the more complex apps this one way flow becomes a huge problem. I really don’t understand why you won’t show CRUD functionality with this pattern. If you have already demonstrated this I kindly ask that you present the link to the video. I really wish the MV pattern was as useful as you advertise because it would make my life much easier. However I think you are trading in functionality for simplicity.
@abidali4156
@abidali4156 Жыл бұрын
@azamsharp , can you please elaborate on this?
@azamsharp
@azamsharp Жыл бұрын
Here is a link to my BudgetApp which uses Core Data. github.com/azamsharp/BudgetApp
@azamsharp
@azamsharp Жыл бұрын
Also check out my article here: azamsharp.com/2022/08/09/intro-to-mv-state-pattern.html BudgetApp (Core Data): github.com/azamsharp/BudgetApp
@DavidKoontz
@DavidKoontz 2 жыл бұрын
Wondering what back porting this to iOS 15 would look like? (Xcode 14 Beta is still NEW)
@azamsharp
@azamsharp Жыл бұрын
You should be able to use Xcode 13 for this example too.
@indiekiduk
@indiekiduk 2 жыл бұрын
Just a small mistake that MovieDetailView should be supplied the existing Store as an @ObservedObject rather creating its own instance as @StateObject. An improvement to the Store would be to have an array of MovieDetail so you don't need to do a web request if the same movie is navigated to twice.
@azamsharp
@azamsharp 2 жыл бұрын
That was simple example. You can add caching layer if you want
STOP Using MVVM with SwiftUI
18:30
azamsharp
Рет қаралды 16 М.
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 79 МЛН
ВОДА В СОЛО
00:20
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 30 МЛН
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 90 МЛН
УГАДАЙ ГДЕ ПРАВИЛЬНЫЙ ЦВЕТ?😱
00:14
МЯТНАЯ ФАНТА
Рет қаралды 4,2 МЛН
How to use the Coordinator pattern in iOS
18:12
Paul Hudson
Рет қаралды 71 М.
MVVM is BAD for SwiftUI - Use MVC Instead! (Yes, MVC)
13:28
Rebeloper - Rebel Developer
Рет қаралды 4,1 М.
SwiftUI's Mini Coordinator Pattern Demystified
23:21
Rebeloper - Rebel Developer
Рет қаралды 1,5 М.
"Only Carlsen Could Play Such A Move And Not Feel Like A Fool"
12:38
DHH discusses SQLite (and Stoicism)
54:00
Aaron Francis
Рет қаралды 57 М.
Why I don't do MVVM anymore
10:56
Flo writes Code
Рет қаралды 7 М.
SwiftUI Architecture: Best Practices for Building iOS Apps
1:06:51
Women Who Code
Рет қаралды 2,5 М.
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 79 МЛН