Git Product home page Git Product logo

vip-example's Introduction

VIP architecture example

This project is a simple example of VIP architecture and network foundation on iOS using:

  • RxSwift for asynchronous tasks and communication between the different components
  • Swinject for dependency injection
  • SnapKit for UI constraint management

There are some differences with the original VIP (real abstraction of the different components, communication with Rx)

Specificities

  • The different components (View, Interactor and Presenter) are abstracted by the protocol ViewType, Interactor and Presenter.
  • The ViewController acts like a bridge between View, Interactor and Presenter. It holds these instances. It also holds a Router instance for navigation if needed.
  • View contains UI elements and exposed through the protocol ViewType:
    • a method "update" which takes in parameter a Driver<T> where T is a view model, to handle a continuous update,
    • a method "request" which returns all the event from the view formatted as an EventRequest
  • Interactor handles business logic and holds Model instances. It takes in input an EventRequest, representation of a request from the View.
  • Presenter handles transformation of data to ViewModel. It takes in input an EventResponse, representation of a response from the Interactor.
  • Router handles navigation from an EventRequest given in input and returns an Observable<EventResponse>
  • Model are abstracted with protocol and always injected in Interactor.
  • Data layer follows the Repository pattern abstracted by the protocol Repository.
  • About folder hierarchy:
    • Foundation contains all transversed extensions/dependencies. Also, there is all the abstraction of VIP components.
    • Scene contains ViewController/Presenter/Interactor/View/ViewModel for each feature of the app.

vip-example's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

endtojunc

vip-example's Issues

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.