Swift: MVP Design Pattern Architecture (2022, iOS, Xcode 12, Swift 5) - iOS for Beginners

Поділитися
Вставка
  • Опубліковано 14 січ 2025

КОМЕНТАРІ • 77

  • @gasparfreak
    @gasparfreak 3 роки тому +13

    This guy is helping us a lot, don't just watch, let's comment and follow so the channel can grow and he can keep doing great material for us.

  • @pebiwhiper4616
    @pebiwhiper4616 3 роки тому +13

    Thanks, waiting for another's Design Patterns
    Clean Swift + MVVM...

  • @dineshreddy9737
    @dineshreddy9737 3 роки тому +8

    Lovely, thanks a lot for explaining MVP in a simple way. This was a lot helpful. Keep the good work. Cheers !!!

  • @bekzatkalybayev5922
    @bekzatkalybayev5922 3 роки тому +7

    Hello! I was reading a lot about MVP, all resources constant is that Model and View not interacting with each other. And even in the beginning of this video where were shown MVP Pattern, there is no line between Model and View. At 13:53 you create instance of Model inside View and I can't understand is this still can be called MVP?

    • @iosprogramming1122
      @iosprogramming1122 2 роки тому +1

      Yes, there is an issue directly creating user instances inside the view controller means you are connecting view to model, which is against the rule MVP. The user's instance should be inside the presenter and with the help of the presenter's instance, it should be used inside the view controller.

    • @21piyushgupta
      @21piyushgupta 2 роки тому

      Yes It does, please note The MVP design pattern has two variations:
      Passive View - in this strategy the view is not aware of the model, and it is updated by the presenter.
      Supervising Controller - in this strategy the view interacts directly with the model to bind data to data controls. The presenter updates the model and manipulates the view only if necessary.

  • @sukycar1
    @sukycar1 2 роки тому +1

    Good example, thanks

  • @goldentapfumachimusinde232
    @goldentapfumachimusinde232 6 місяців тому

    Much Appreciated ❤

  • @myungsup1250
    @myungsup1250 3 роки тому +1

    Thanks for the great tutorial!

  • @govind20246
    @govind20246 3 роки тому +1

    Really nice ..!

  • @se7enzz258
    @se7enzz258 3 роки тому +3

    VIPER, MVP 😊. I learnt a lot from your videos, thanks ❤️

  • @samirrana8663
    @samirrana8663 3 роки тому +1

    Nice tutorial!!

  • @IhorFedii-n1i
    @IhorFedii-n1i 3 роки тому +1

    Thank!!!

    • @iOSAcademy
      @iOSAcademy  3 роки тому

      Youre welcome

    • @IhorFedii-n1i
      @IhorFedii-n1i 3 роки тому

      ​@@iOSAcademy i understand engish bad,Nevertheless it is so usefull for me. you do great job!

  • @orzhan6604
    @orzhan6604 3 роки тому +2

    I have a question. Why your MVP presenter do the same work as MVC Model?

  • @AdnanKhan-ug1qn
    @AdnanKhan-ug1qn 3 роки тому +1

    Man.. that's really great video... 😇😇

  • @ireneqiao1183
    @ireneqiao1183 3 роки тому

    Thanks for the explanation and demo! Very helpful

  • @iosplus6702
    @iosplus6702 3 роки тому +3

    Hello, Good Job really thanks, but I have some concerns, is it good to import UIkit at the presenter? what I mean is that the view controller only should Import UIKit to deal with the view.
    2- the view Controller shouldn't include the user Model it should just display data so the table view configuration is better to be done at the presenter.

  • @valerynevzorov3432
    @valerynevzorov3432 2 роки тому +1

    Thanks. It will be great if you make a video where you create one app with a different design patterns.

  • @ianfagundes84
    @ianfagundes84 3 роки тому +1

    Amazing very good explanation. I could understand, it made things looks simple 😊
    Thank you

  • @eric9964
    @eric9964 3 роки тому

    Is that not a memory leak with the controller referencing the presenter and the presenter referencing the controller?

  • @junaidkamoka4059
    @junaidkamoka4059 2 роки тому +1

    Thanks..
    Difference btw MVVM and MVP

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

    there's a lot of little things apart from the main topic, that's nice

  • @hungpham-qb6ch
    @hungpham-qb6ch 3 роки тому +2

    I don't understand why you code " & " in " UserPresenterDelegate & UIViewController ". Could you explain or give me keyword for that ?

    • @iOSAcademy
      @iOSAcademy  3 роки тому +1

      It basically means an object that is both types

  • @gbu85
    @gbu85 3 роки тому +1

    Awesome explanation :) May I suggest a vip pattern as well?

  • @josemanuelfg2409
    @josemanuelfg2409 3 роки тому +3

    I had a discussion about who was an artist, and almost everyone said writers, singers, dancers, ...., it's a pity that there's no too much people able to recognize the art of doing something like you do in this tutorial.... for me it's real art...

    • @iOSAcademy
      @iOSAcademy  3 роки тому +1

      I always have said code is art! I appreciate it

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

      You are pretty weirdo

  • @ItsMeNalinda
    @ItsMeNalinda 3 роки тому +1

    Good content, Thanks.
    But how we can test the business logic layer (presenter) with unit test. Can someone help?

  • @joakimhellgren3801
    @joakimhellgren3801 3 роки тому +3

    Your content is as always really insightful, but I’m confused over this video... doesn’t importing UIKit in the presenter break the rule of keeping the presenter completely agnostic, or is this considered as an accepted practice?

    • @isurujn
      @isurujn 3 роки тому +1

      Agreed. I've seen tutorials on MVP where they advice against mixing UI code inside the presenter. Personally, I think I like that approach. So that we can make the presenter testable.

    • @21piyushgupta
      @21piyushgupta 2 роки тому

      Please note, The MVP design pattern has two variations:
      Passive View - in this strategy the view is not aware of the model, and it is updated by the presenter.
      Supervising Controller - in this strategy the view interacts directly with the model to bind data to data controls. The presenter updates the model and manipulates the view only if necessary.

  • @glennadams7047
    @glennadams7047 3 роки тому +1

    How prevalent is this pattern in IOS dev ? I have seen it in .NET frequently.

    • @iOSAcademy
      @iOSAcademy  3 роки тому

      Its not super common but def exists

  • @nurlanakylbekov7266
    @nurlanakylbekov7266 3 роки тому +1

    Great tutorial as always🔥. The idea for the next videos is maybe server-side-swift? Docker, Vapor, Kaitura? What is Moya🤔?

  • @rev_kous9275
    @rev_kous9275 3 роки тому +2

    Waiting for Clean Swift architecture.

  • @jaqb17
    @jaqb17 3 роки тому +1

    soooo basically its VIPER without an interactor and router?

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

    MVVM and MVP they both look similar, Its just that "view model" is mediator in MVVM and "presenter" is mediator in MVP.
    Could you make a video differentiating these two patterns!

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

      yeah is the same thing, the difference in concept is that mvvm uses observers and mvp uses protocols and a delegate, at the end we could say is the same shit. You could add an escaping closure to all the "presenter" functions and avoid all the delegate and protocols boilerplate. This is actually like react, except that you *implicity* "pass functions through the delegate" to the "handler component" and the handler component executes those functions.

  • @paulorodrigues8475
    @paulorodrigues8475 3 роки тому

    Make a vídeo with vip/clean swift architecture please?!!

  • @Jack-vy9bu
    @Jack-vy9bu 3 роки тому

    how to create MVP in swiftUI?

  • @orzhan6604
    @orzhan6604 3 роки тому +1

    Presenter do the same work as Model in MVC.

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

    When I embed our UsersViewController in Navigation Controller and then start the application, I get a message in console: [Assert] UINavigationBar decoded as unlocked for UINavigationController, or navigationBar delegate set up incorrectly. Inconsistent configuration may cause problems. navigationController=, navigationBar= delegate=0x16081da00.
    In cause of this problem at the end of the project, when I ran the app, I can see the navbar but can't see any tableview and data. What I need to do to fix this problem?

  • @chaudhryumair007
    @chaudhryumair007 3 роки тому

    i believe if the UI related things could stay in ViewController class because the end result is that we want to separate functionalities (UIKIT relates to ViewController/View , presenter for business logic and model is as per its name) . Resr depends on personal choice
    Regards

  • @ryankanno2562
    @ryankanno2562 3 роки тому

    Definitely prefer MVP over VIP or VIPER.

    • @developer-juice-Khailenno
      @developer-juice-Khailenno 2 роки тому

      than you only have worked on small apps.. what about universal deep link or deep linking where complex navigation is required??

  • @Денис-ж3ф5р
    @Денис-ж3ф5р 3 роки тому

    Nothingness, zero, nil, null, nothing, void, that's how I describe how I understand the difference between MVC and MVP.

  • @nullandvoid5166
    @nullandvoid5166 3 роки тому

    Presentor should not contain Uikit

  • @Денис-ж3ф5р
    @Денис-ж3ф5р 3 роки тому +1

    I feel like I'm at the level on which it's way easier to read documentation then watch.

    • @iOSAcademy
      @iOSAcademy  3 роки тому +1

      Great place to be!

    • @developer-juice-Khailenno
      @developer-juice-Khailenno 2 роки тому

      there is no apple documentation for design patterns..

    • @Денис-ж3ф5р
      @Денис-ж3ф5р 2 роки тому

      @@developer-juice-Khailenno do not read apple’s documentation on MVP then. There is a bunch of material on the internet.

  • @simple.efficace
    @simple.efficace 3 роки тому +1

    First