Comments (7)
I agree this is worth doing.
As an example use-case, what do you think about the notion of "editing" a TODO after you've created it? Would that exhibit the behavior you're hoping to see?
Thanks,
- Conrad
from viper-todo.
Sorry for bothering you on multiple channels, @cnstoll
I just found this and think GitHub is the best place to discuss this issue.
For a simple master-detail view, I would enhance the View Model with the properties needed for both master and detail view.
List View (Table Cell tapped) -> List Presenter ---(ViewModel)---> List Wireframe ---(ViewModel)---> Detail Wireframe --> ... -> Detail View
For an editing matter you could hold a reference to the database ID, but that would be a violation of the layer independence? I really don't know. Do you have any working implementations yet?
from viper-todo.
This would be very useful for me as well. Thanks in advance.
from viper-todo.
How about passing the ToDoItem from List View (row tapped) -> List Presenter (event handler) -> List Wireframe -> Detail Wireframe
Think of the Wireframe as the gateway and also the input for its module
from viper-todo.
The editing use case would not be much different from adding, the primary difference being that you need to have a way of identifying the TodoItem you want to edit. You shouldn't pass the actual TodoItem from the List view but get a new copy of the data in your editing interface.
The only identifying information for a TodoItem you have in the List UI is the name and due date, so the List module interface could define a new method for updating:
- (void)updateEntryWithName:(NSString *)name dueDate:(NSDate *)dueDate;
The rest of the behavior would follow closely to what is done with adding, the exception being that the Update module would receive entity data to pre-populate its view. You could even consider abstracting the editing interface as its own view controller and then add it as a child view controller in both the Add and Update modules.
from viper-todo.
Hi @adamschlag, what about the case when you do not have all the information about the todo item in the List view, you need for Editing view? (I.e. you only show name and date on List view, but, let's imagine there is more to todo item and you can edit in Editing view). Would you then pass the ID of the todo item to Editing wireframe, so that Editing provider could fetch all the data from the model (server or database)?
from viper-todo.
Yes, at least that is what I've done. That way you don't have to pass more data than you need to any of your presentation modules, but you have a way to tie data together when navigating to a module that requires more detail.
from viper-todo.
Related Issues (6)
- Retain cycles HOT 3
- Lazy Loading Images Strategy HOT 1
- VIPER Issues HOT 49
- Editing entities HOT 2
- AddDismissalTransition bug HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from viper-todo.