fortechromania / ios-mvp-clean-architecture Goto Github PK
View Code? Open in Web Editor NEWDemo iOS application built to highlight MVP (Model View Presenter) and Clean Architecture concepts
License: MIT License
Demo iOS application built to highlight MVP (Model View Presenter) and Clean Architecture concepts
License: MIT License
if there is a btn on cell. when i press the btn, how to deal with it ,if use this architecture. i am confuse about it.
Thank you for this awesome example project!
I'm interested how would you name and where would you put a protocol and its implementation that can queue and manage multiple tasks with final completion callback, pausing, retrying and etc. Some kind of abstraction for NSOperation or GCD.
Does that counts as iOS specific framework? Or is it Application Logic UseCase? Or maybe Application Logic Gateway?
Why does the configurator have to be part of the ViewController? I see no reason for it. The call to configure which wires up the presenter into the ViewController could also be done directly on creation of the Configurator.
One additional problem because of that - all instance variables hold by the Configurator are kept alive during the whole lifetime of the ViewController. But they are anyway passed during the configure() call to the right places. So they are kept twice.
But maybe there is something I am not aware of.
Thanks.
On my first UIViewController, I have a button which leads to another VC with a list of entries. When I select an entry on this, I would like to return it back to the first UIViewController.
But currently I really have problems implementing this with this architecture...
One suggestion for further improvement:
The weak
view reference in the router can be changed to unowned
.
As well as the weak
view reference in the presenter.
Because the ViewController is that object which keeps the whole "module" alive both router and presenter depend on the ViewController to exist. As soon as the ViewController is deallocated both the router and presenter will be deallocated as a reaction to it. So it can never happen that the view reference turns into nil.
This saves one from all the guard statements with strange or non-existent error handling.
Also the optional calls like view?.
can be removed and the code keeps concise and clear.
It's not really an issue.
But, how we should do that without breaking the MVP?
Great work by the way :)
I have a viewcontroller that has multiple usecases, both of which make calls to an Api and does so on viewcontroller load. Currently, a operationqueue calls the usecases 1 at a time. How would I approach making these calls concurrent? I want both usecases to have their own thread to make their call on load.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.