Latest 0.0.3
License MIT
Platforms ios 8.0, osx 10.9
Dependencies SWXMLHash, Stencil

MotoSwift. Managed Objects to Swift.

Converts Core Data model to Swift.


  1. Install MotoSwift by downloading MotoSwift.pkg from the latest GitHub release and running it.

  2. From sources.

Clone or download project.

Run make install

If you need all components in one folder run make bundle. Now you can copy whole motoswift folder, and run motoswift/bin/motoswift from any place


  • motoswift entity – Applies entity template and renders every entity to separate file


    • –model – Path to CoreData model.
    • –file-mask – File name mask, e.g: "_{{class}}.swift".
    • –template – Path to entity template.
    • –output – Output directory.
    • –rewrite – Rewrite if exists
  • motoswift model – Applies model template and prints result to output


    • –model – Path to CoreData model.
    • –template – Path to model template.
    • –output – Output file path. If missed prints to console
    • –rewrite – Rewrite file if exists.

Additional documentation

MotoSwift uses Stencil as template language


  1. XCode style

Generate class files:

motoswift entity --model ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld --template ./Templates/class.stencil --output ./SampleOutput/XCode --no-rewrite --file-mask "{{class}}+CoreDataClass.swift"

Generate properties files:

motoswift entity --model ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld --template ./Templates/properties.stencil --output ./SampleOutput/XCode --rewrite --file-mask "{{class}}+CoreDataProperties.swift"


  1. Mogenerator style

Generate machine files:

motoswift entity --model ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld --template ./Templates/machine.stencil --output ./SampleOutput/Machine --rewrite --file-mask "_{{class}}.swift"


Generate human files:

motoswift entity --model ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld --template ./Templates/human.stencil --output ./SampleOutput/Human --no-rewrite --file-mask "{{class}}.swift"


Latest podspec

    "name": "MotoSwift",
    "version": "0.0.3",
    "summary": "Generates managed object subclasses from Core Data model.",
    "description": "Parses Core Data model, and applies templates for generation swift code",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Igor Palaguta": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.0.3"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    "source_files": "Source/MotoSwiftFramework/**/*.swift",
    "dependencies": {
        "SWXMLHash": [],
        "Stencil": []
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This