Code Monkey home page Code Monkey logo

rxswift-xcode-templates's Introduction

RxSwift Xcode file templates

GitHub release GitHub fork release

A handful of Xcode file templates for projects that use RXSwift and MVVM

What this is about:

These file templates are meant to be used for the following app architecture setup:

Let's call each "screen" or "view" in the app a Scene. So if you have an app that has a list view, a detail view and a login view you have 3 Scenes.

Each Scene consists of the following elements:

  1. A ViewController (that displays the data from the ViewModel out and sends user input to the ViewModel input using binding in both cases)

  2. A ViewModel (that provides the ViewController with displayabe Data by defining one or more transformation chains connecting the input to the output)

  3. A Router (that takes care of routing to another scene)

  4. A Builder (that initializes and connects the Router, ViewModel and ViewController and returns the ViewController)

In most cases the ViewModel uses other helper objects (e.g. an APIClient) to access and mutate the model or download data but those might be shared by multiple Scenes so I don't consider them part of a scene.

How to use it:

  1. Download the RxSwift folder and add it to the following folder on your machine: ~/Library/Developer/Xcode/Templates

  2. When you want to add a new scene to your app, open the New File dialog and choose RxSwift in the left column

  3. Select Scene and click Next

  4. Enter a name for the Scene. As you can see that name will be used as a prefix for all the 4 classes that will be needed for the scene (see above)

  5. Click Next and save the scene. Xcode now creates the 4 classes needed for the scene. You will get 2 compile errors, because you still have to create the APIClient that the ViewModel references.

rxswift-xcode-templates's People

Contributors

pixeldock avatar yaroslav-v avatar

Watchers

James Cloos avatar  avatar

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.