Giter Club home page Giter Club logo

viper-swift's Introduction

VIPER-SWIFT

An example Todo list app written in Swift using the VIPER architecture.

viper-swift's People

Contributors

cnstoll avatar garohussenjian avatar jeffgilbert-mm avatar zntfdr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

viper-swift's Issues

Autogen

Not an issue, sorry!

Do you guys use a tool to auto-generate the basic /module files? Feels like it'd be useful.

ListWireframe isn't self contained; knows about AddWireframe and UIWindow

Hi, fantastic demo project. I think it really shows the degree to which VIPER helps isolate single responsibilities.

I do have a question over why Wireframes are as they are though.

Imagine that I want to actually build an iPad version of this app and I want to display a List of TODOS inside of a popover, and we don't offer an option to add items at all — but the iPhone version should remain unchanged.

So intuitively I'd think "Easy! We'll just create a new iPad-only target, and we can pick-up-and-use the List module completely unchanged. We just have to install the List view controller into a popover instead, and we make sure that we don't use the Add module and we are done!". This is such that both the iPhone and iPad app share exactly the same conceptual module: List completely unchanged.

Except — this won't work. ListWireframe is considered a 'part' of the List module (judging purely by looking at the file hierarchy). It currently only knows how to present the List into a UIWindow. What if I wanted to present the List from a ViewController? Or a UIView / CGRect from which the popover pops out? Surely ListWireframe cannot know of all possible cases in which its ViewController can be presented. Even if we do put that case in, ListWireframe now has two responsibilities, violating the SRP.

You end up thinking "Hmmm. I need to make an iPad-specific Wireframe class for List".

Another thing is, it also knows about AddWireframe, which means that if you were to lift the whole file hierarchy of List out into a separate project just to run it against some test table of TODOs, the code won't compile: AddWireframe is an inherent collaborator of a list.

This just isn't right to me. What wireframes do (navigation) is actually application-specific. It doesn't belong in modules. I see wireframes not as classes, but rather, protocols that let Presenters 'request' navigation behaviours from some super-module. Only the super module (in our case, probably a RootWireframe knows about both List and Add such that it can get them to work together. i.e. the super-module 'routes' navigation requests to the relevant module, so that e.g. Add can present itself from the List viewController.

Any thoughts? Have I just completely missed the original intention behind Wireframes?

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.