Skip to content

Templates for XCode to generate the Uncle Bob's Clean Architecture classes system for Swift 3.0 and Objective-C.

License

Notifications You must be signed in to change notification settings

IvanRublev/CleanTemplates

Repository files navigation

Clean Architecture XCode templates

This is a set of templates for XCode to generate the Uncle Bob's Clean Architecture classes system for Swift 3.0 and Objective-C.

This work is based on Clean Swift Templates project (http://clean-swift.com) by Raymond Law. Portions are taken from templates project by HELM (https://github.com/HelmMobile/clean-swift-templates).

To learn more about Clean Swift and the VIP cycle, read: http://clean-swift.com/clean-swift-ios-architecture To get the original concept of the Clean Architecture, see Uncle Bob's explanation: https://www.youtube.com/watch?v=o_TH-Y78tt4

Example

See the example MyLife2 app that is written in Swift via the Clean Templates.

Installation

To install the Clean Architecture XCode templates, run:

make install

To uninstall the Clean Architecture XCode templates, run:

make uninstall

Usage

Open XCode. Make new or open existing project.

I recommend making project's source code folder structure to be same as view controllers structure. Make Scenes folder and create one subfolder for each view controller you have in the project.

To add new set of scene classes to the project

  1. Select the scene subfolder.
  2. Use menu File->New->File... or press N. Choose template window appears.
  3. Scroll to "1. Clean Architecture Swift" (or "2. Clean Architecture Objective-C") section depending on the language you use.
  4. Select "Scene" template and press Next. Choose options window appears.
  5. Enter the name of the scene and select the view controller's base class (f.e. UITableViewController) from the drop down list.
  6. Press Next. Scene classes are added to your project!

To add unit tests for the scene

  1. Select unit tests subfolder in the project.
  2. Use menu File->New->File... or press N. Choose template window appears.
  3. Scroll to "1. Clean Architecture Swift" (or "2. Clean Architecture Objective-C") section depending on the language you use.
  4. Select "Quick Unit Test" if you use Quick/Nimble frameworks for unit testing (or "Unit Tests" for XCTest based tests) and press Next. Unit tests for Interactor Presenter and View Controller are added to your project!

Compatability

  • XCode 7.3+
  • Swift 3.0+
  • Objective-C

About

Templates for XCode to generate the Uncle Bob's Clean Architecture classes system for Swift 3.0 and Objective-C.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published