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

  Рет қаралды 28,443

iOS Academy

iOS Academy

Күн бұрын

Пікірлер: 77
@gasparfreak
@gasparfreak 3 жыл бұрын
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.
@nieeehlsss
@nieeehlsss 3 жыл бұрын
Yes
@pebiwhiper4616
@pebiwhiper4616 3 жыл бұрын
Thanks, waiting for another's Design Patterns Clean Swift + MVVM...
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Coming soon
@dineshreddy9737
@dineshreddy9737 3 жыл бұрын
Lovely, thanks a lot for explaining MVP in a simple way. This was a lot helpful. Keep the good work. Cheers !!!
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Youre welcome!
@bekzatkalybayev5922
@bekzatkalybayev5922 3 жыл бұрын
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 жыл бұрын
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.
@goldentapfumachimusinde232
@goldentapfumachimusinde232 5 ай бұрын
Much Appreciated ❤
@sukycar1
@sukycar1 2 жыл бұрын
Good example, thanks
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Youre welcome
@se7enzz258
@se7enzz258 3 жыл бұрын
VIPER, MVP 😊. I learnt a lot from your videos, thanks ❤️
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Youre welcome
@josemanuelfg2409
@josemanuelfg2409 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 жыл бұрын
I always have said code is art! I appreciate it
@Adriano70911
@Adriano70911 2 жыл бұрын
You are pretty weirdo
@orzhan6604
@orzhan6604 3 жыл бұрын
I have a question. Why your MVP presenter do the same work as MVC Model?
@valerynevzorov3432
@valerynevzorov3432 2 жыл бұрын
Thanks. It will be great if you make a video where you create one app with a different design patterns.
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Coming soon
@AdnanKhan-ug1qn
@AdnanKhan-ug1qn 3 жыл бұрын
Man.. that's really great video... 😇😇
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Thanks
@myungsup1250
@myungsup1250 3 жыл бұрын
Thanks for the great tutorial!
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Youre welcome
@iosplus6702
@iosplus6702 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.
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Its a bit subjective
@gbu85
@gbu85 3 жыл бұрын
Awesome explanation :) May I suggest a vip pattern as well?
@govind20246
@govind20246 3 жыл бұрын
Really nice ..!
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Thanks!
@ireneqiao1183
@ireneqiao1183 3 жыл бұрын
Thanks for the explanation and demo! Very helpful
@abdurakhmonjamoliddinov7019
@abdurakhmonjamoliddinov7019 2 жыл бұрын
there's a lot of little things apart from the main topic, that's nice
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Glad you liked the video
@samirrana8663
@samirrana8663 3 жыл бұрын
Nice tutorial!!
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Thanks!
@ItsMeNalinda
@ItsMeNalinda 3 жыл бұрын
Good content, Thanks. But how we can test the business logic layer (presenter) with unit test. Can someone help?
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Youre welcome
@junaidkamoka4059
@junaidkamoka4059 2 жыл бұрын
Thanks.. Difference btw MVVM and MVP
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Youre welcome
@ianfagundes84
@ianfagundes84 3 жыл бұрын
Amazing very good explanation. I could understand, it made things looks simple 😊 Thank you
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Thank you
@ianfagundes84
@ianfagundes84 3 жыл бұрын
@@iOSAcademy 😉
@nurlanakylbekov7266
@nurlanakylbekov7266 3 жыл бұрын
Great tutorial as always🔥. The idea for the next videos is maybe server-side-swift? Docker, Vapor, Kaitura? What is Moya🤔?
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Thanks for the idea!
@joakimhellgren3801
@joakimhellgren3801 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 жыл бұрын
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.
@paulorodrigues8475
@paulorodrigues8475 3 жыл бұрын
Make a vídeo with vip/clean swift architecture please?!!
@hungpham-qb6ch
@hungpham-qb6ch 3 жыл бұрын
I don't understand why you code " & " in " UserPresenterDelegate & UIViewController ". Could you explain or give me keyword for that ?
@iOSAcademy
@iOSAcademy 3 жыл бұрын
It basically means an object that is both types
@eric9964
@eric9964 3 жыл бұрын
Is that not a memory leak with the controller referencing the presenter and the presenter referencing the controller?
@sergeystarchenkov9992
@sergeystarchenkov9992 3 жыл бұрын
weak link
@IhorFedii-n1i
@IhorFedii-n1i 3 жыл бұрын
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!
@glennadams7047
@glennadams7047 3 жыл бұрын
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
@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.
@rev_kous9275
@rev_kous9275 3 жыл бұрын
Waiting for Clean Swift architecture.
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Soon
@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?
@Jack-vy9bu
@Jack-vy9bu 3 жыл бұрын
how to create MVP in swiftUI?
@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
@jaqb17
@jaqb17 3 жыл бұрын
soooo basically its VIPER without an interactor and router?
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Basically
@orzhan6604
@orzhan6604 3 жыл бұрын
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 жыл бұрын
I feel like I'm at the level on which it's way easier to read documentation then watch.
@iOSAcademy
@iOSAcademy 3 жыл бұрын
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 жыл бұрын
First
@iOSAcademy
@iOSAcademy 3 жыл бұрын
First reply! 🙃
Everything You NEED to Know About Client Architecture Patterns
5:51
MVP Architecture iOS (Swift)
9:06
Venu Gopal Tewari
Рет қаралды 2,2 М.
What Is MVC? Simple Explanation
10:40
Traversy Media
Рет қаралды 519 М.
Best of CES 2025
14:50
The Verge
Рет қаралды 282 М.
How to use the Coordinator pattern in iOS
18:12
Paul Hudson
Рет қаралды 72 М.
MVVM vs MVP: what's the difference? 🤔
9:27
Vincent Pradeilles
Рет қаралды 10 М.