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

Поделиться
HTML-код
  • Опубликовано: 1 дек 2024

Комментарии • 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...

  • @sukycar1
    @sukycar1 2 года назад +1

    Good example, thanks

  • @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 года назад +6

    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 Год назад

      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.

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

  • @goldentapfumachimusinde232
    @goldentapfumachimusinde232 4 месяца назад

    Much Appreciated ❤

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

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

  • @govind20246
    @govind20246 3 года назад +1

    Really nice ..!

  • @myungsup1250
    @myungsup1250 3 года назад +1

    Thanks for the great tutorial!

  • @se7enzz258
    @se7enzz258 3 года назад +3

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

  • @samirrana8663
    @samirrana8663 3 года назад +1

    Nice tutorial!!

  • @valerynevzorov3432
    @valerynevzorov3432 2 года назад +1

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

  • @nalindawickramarathna8730
    @nalindawickramarathna8730 3 года назад +1

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

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

  • @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 Год назад

      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.

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

  • @junaidkamoka4059
    @junaidkamoka4059 2 года назад +1

    Thanks..
    Difference btw MVVM and MVP

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

  • @ireneqiao1183
    @ireneqiao1183 3 года назад

    Thanks for the explanation and demo! Very helpful

  • @gbu85
    @gbu85 3 года назад +1

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

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

  • @eric9964
    @eric9964 3 года назад

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

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

  • @ianfagundes84
    @ianfagundes84 3 года назад +1

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

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

  • @jaqb17
    @jaqb17 3 года назад +1

    soooo basically its VIPER without an interactor and router?

  • @rev_kous9275
    @rev_kous9275 3 года назад +2

    Waiting for Clean Swift architecture.

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

  • @paulorodrigues8475
    @paulorodrigues8475 2 года назад

    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.

  • @Денис-ж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.

  • @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 года назад +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.

  • @nullandvoid5166
    @nullandvoid5166 3 года назад

    Presentor should not contain Uikit

  • @simple.efficace
    @simple.efficace 3 года назад +1

    First