Performing Network Operations Using MV State Pattern in SwiftUI

Поділитися
Вставка
  • Опубліковано 27 жов 2024

КОМЕНТАРІ • 15

  • @scriptedpixelsltd
    @scriptedpixelsltd 5 місяців тому

    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

  • @hamslammula6182
    @hamslammula6182 2 роки тому +5

    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 2 роки тому

      @azamsharp , can you please elaborate on this?

    • @azamsharp
      @azamsharp  2 роки тому

      Here is a link to my BudgetApp which uses Core Data.
      github.com/azamsharp/BudgetApp

    • @azamsharp
      @azamsharp  2 роки тому

      Also check out my article here:
      azamsharp.com/2022/08/09/intro-to-mv-state-pattern.html
      BudgetApp (Core Data):
      github.com/azamsharp/BudgetApp

  • @vanylaskywalker
    @vanylaskywalker Рік тому +3

    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 5 місяців тому

      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 5 місяців тому

      @@scriptedpixelsltd Could you show that they are the same store? (Looking for clarification too)

  • @findthebug
    @findthebug Рік тому

    Thanks❤

  • @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

  • @DavidKoontz
    @DavidKoontz 2 роки тому

    Wondering what back porting this to iOS 15 would look like? (Xcode 14 Beta is still NEW)

    • @azamsharp
      @azamsharp  2 роки тому

      You should be able to use Xcode 13 for this example too.

  • @judy8821
    @judy8821 2 роки тому

    Nice