Giter VIP home page Giter VIP logo

Comments (7)

cnstoll avatar cnstoll commented on September 4, 2024

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.

sebastianwr avatar sebastianwr commented on September 4, 2024

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.

daria-kopaliani avatar daria-kopaliani commented on September 4, 2024

This would be very useful for me as well. Thanks in advance.

from viper-todo.

onmyway133 avatar onmyway133 commented on September 4, 2024

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.

 avatar commented on September 4, 2024

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.

daria-kopaliani avatar daria-kopaliani commented on September 4, 2024

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.

 avatar commented on September 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.