Giter Club home page Giter Club logo

clean-swift-template's Introduction

CleanSwift Template

This is a CleanSwift template modified from the original, to accomodate common project usage.

Modifications

  1. All Files

    • All file templates are updated so that upon scene generation, the app still works without throwing errors.
    • Pre-built with 4 common use cases:
      1. Upon entering a screen - fetchFromLocalDataStore(with:)
        • There's almost always local data to be displayed on the screen.
      2. Upon entering a screen - fetchFromRemoteDataStore(with:)
        • Sometimes a data need to be fetched from an external source.
        • This use case decouples from local data fetching use case and allows it to be reused if needed (ie. Pull-To-Refresh).
      3. Tracking analytics - trackAnalytics(with:)
        • Sometimes a triggered UI element needs to be tracked for app improvements.
        • This use case made it easier.
      4. Upon leaving a screen - perform<SCENE_NAME>(with:)
        • In order to leave a screen, a use case is almost always needed.
  2. Models

    • The template generates a file appended with the word models to make it more obvious.
  3. Interactor, Presenter & ViewController

    • Each Use Case logic would have the comment header // MARK: - Use Case - for better readability between the Use Case & other functions.
  4. Unit Test

    • The templates are also updated to test the pre-built use cases.
    • A template that is written using the Quick and Nimble libraries are also added if it's preferred over XCTest.
  5. Removed

    • UICollectionViewController and UITableViewController templates are removed since the templates use the UIViewController templates anyway.

Installation

  1. Clone this repository

  2. From this repository:

    To install the Clean Swift Xcode templates,run:

    $ make install_templates

    To uninstall the Clean Swift Xcode templates, run:

    $ make uninstall_templates

References

To learn more about Clean Swift and the VIP cycle, read:

There is a sample app available at:

clean-swift-template's People

Contributors

sentulasia avatar zaimramlan avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

clean-swift-template's Issues

swift lint for for unwrapping

to add this to routes template:

// swiftlint:disable force_unwrapping
passData(to: &destinationDS, from: dataStore!)
// swiftlint:enable force_unwrapping

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.